Changeset 409c2de for otr.c


Ignore:
Timestamp:
2011-10-03T15:18:00Z (9 years ago)
Author:
unknown <pesco@…>
Branches:
master
Children:
aea22cd
Parents:
e67e513
Message:

send user-specific otr messages generated by us as notices from that user

File:
1 edited

Legend:

Unmodified
Added
Removed
  • otr.c

    re67e513 r409c2de  
    634634        struct im_connection *ic = check_imc(opdata, accountname, protocol);
    635635        irc_t *irc = ic->bee->ui_data;
     636        irc_user_t *u = peeruser(irc, username, protocol);
    636637        char hunam[45];         /* anybody looking? ;-) */
    637638       
    638639        otrl_privkey_hash_to_human(hunam, fingerprint);
    639         irc_rootmsg(irc, "new fingerprint for %s: %s",
    640                 peernick(irc, username, protocol), hunam);
     640        if(u) {
     641                irc_usernotice(u, "new fingerprint: %s", hunam);
     642        } else {
     643                /* this case shouldn't normally happen */
     644                irc_rootmsg(irc, "new fingerprint for %s/%s: %s",
     645                        username, protocol, hunam);
     646        }
    641647}
    642648
     
    667673        if(!otr_update_modeflags(irc, u)) {
    668674                char *trust = u->flags & IRC_USER_OTR_TRUSTED ? "trusted" : "untrusted!";
    669                 irc_rootmsg(irc, "conversation with %s is now off the record (%s)", u->nick, trust);
     675                irc_usernotice(u, "conversation is now off the record (%s)", trust);
    670676        }
    671677}
     
    687693        otr_update_uflags(context, u);
    688694        if(!otr_update_modeflags(irc, u))
    689                 irc_rootmsg(irc, "conversation with %s is now in the clear", u->nick);
     695                irc_usernotice(u, "conversation is now in cleartext");
    690696}
    691697
     
    708714        if(!otr_update_modeflags(irc, u)) {
    709715                char *trust = u->flags & IRC_USER_OTR_TRUSTED ? "trusted" : "untrusted!";
    710                 irc_rootmsg(irc, "otr connection with %s has been refreshed (%s)", u->nick, trust);
     716                irc_usernotice(u, "otr connection has been refreshed (%s)", trust);
    711717        }
    712718}
Note: See TracChangeset for help on using the changeset viewer.