diff options
| author | unknown <pesco@khjk.org> | 2011-10-03 17:18:00 +0200 | 
|---|---|---|
| committer | unknown <pesco@khjk.org> | 2011-10-03 17:18:00 +0200 | 
| commit | 409c2dec87731dae72dfbaae6b3fdf4a9c53dea2 (patch) | |
| tree | e9c3142d3a551ca192d3512b8aba2d474bd641bb | |
| parent | e67e513a16f3e545fd71eb176aac83d41a1dc271 (diff) | |
send user-specific otr messages generated by us as notices from that user
| -rw-r--r-- | otr.c | 16 | 
1 files changed, 11 insertions, 5 deletions
| @@ -633,11 +633,17 @@ void op_new_fingerprint(void *opdata, OtrlUserState us,  {  	struct im_connection *ic = check_imc(opdata, accountname, protocol);  	irc_t *irc = ic->bee->ui_data; +	irc_user_t *u = peeruser(irc, username, protocol);  	char hunam[45];		/* anybody looking? ;-) */  	otrl_privkey_hash_to_human(hunam, fingerprint); -	irc_rootmsg(irc, "new fingerprint for %s: %s", -		peernick(irc, username, protocol), hunam); +	if(u) { +		irc_usernotice(u, "new fingerprint: %s", hunam); +	} else { +		/* this case shouldn't normally happen */ +		irc_rootmsg(irc, "new fingerprint for %s/%s: %s", +			username, protocol, hunam); +	}  }  void op_write_fingerprints(void *opdata) @@ -666,7 +672,7 @@ void op_gone_secure(void *opdata, ConnContext *context)  	otr_update_uflags(context, u);  	if(!otr_update_modeflags(irc, u)) {  		char *trust = u->flags & IRC_USER_OTR_TRUSTED ? "trusted" : "untrusted!"; -		irc_rootmsg(irc, "conversation with %s is now off the record (%s)", u->nick, trust); +		irc_usernotice(u, "conversation is now off the record (%s)", trust);  	}  } @@ -686,7 +692,7 @@ void op_gone_insecure(void *opdata, ConnContext *context)  	}  	otr_update_uflags(context, u);  	if(!otr_update_modeflags(irc, u)) -		irc_rootmsg(irc, "conversation with %s is now in the clear", u->nick); +		irc_usernotice(u, "conversation is now in cleartext");  }  void op_still_secure(void *opdata, ConnContext *context, int is_reply) @@ -707,7 +713,7 @@ void op_still_secure(void *opdata, ConnContext *context, int is_reply)  	otr_update_uflags(context, u);  	if(!otr_update_modeflags(irc, u)) {  		char *trust = u->flags & IRC_USER_OTR_TRUSTED ? "trusted" : "untrusted!"; -		irc_rootmsg(irc, "otr connection with %s has been refreshed (%s)", u->nick, trust); +		irc_usernotice(u, "otr connection has been refreshed (%s)", trust);  	}  } | 
