From f1cf01c5eb91fdd3effe04a27cdc5a268ff5ee66 Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Wed, 29 Jun 2011 03:59:46 +0200 Subject: report trust state in gone_secure/still_secure messages --- otr.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'otr.c') diff --git a/otr.c b/otr.c index 843aa3fa..3968da96 100644 --- a/otr.c +++ b/otr.c @@ -641,8 +641,10 @@ void op_gone_secure(void *opdata, ConnContext *context) } otr_update_uflags(context, u); - if(!otr_update_modeflags(irc, u)) - irc_usermsg(irc, "conversation with %s is now off the record", u->nick); + if(!otr_update_modeflags(irc, u)) { + char *trust = u->flags & IRC_USER_OTR_TRUSTED ? "trusted" : "untrusted!"; + irc_usermsg(irc, "conversation with %s is now off the record (%s)", u->nick, trust); + } } void op_gone_insecure(void *opdata, ConnContext *context) @@ -680,8 +682,10 @@ void op_still_secure(void *opdata, ConnContext *context, int is_reply) } otr_update_uflags(context, u); - if(!otr_update_modeflags(irc, u)) - irc_usermsg(irc, "otr connection with %s has been refreshed", u->nick); + if(!otr_update_modeflags(irc, u)) { + char *trust = u->flags & IRC_USER_OTR_TRUSTED ? "trusted" : "untrusted!"; + irc_usermsg(irc, "otr connection with %s has been refreshed (%s)", u->nick, trust); + } } void op_log_message(void *opdata, const char *message) -- cgit v1.2.3