Changeset a0c6fc5
- Timestamp:
- 2011-06-25T22:28:26Z (13 years ago)
- Branches:
- master
- Children:
- 1dc00fe
- Parents:
- 9e7a566
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r9e7a566 ra0c6fc5 164 164 165 165 -include .depend/*.d 166 # DO NOT DELETE -
otr.c
r9e7a566 ra0c6fc5 162 162 void otr_smp_or_smpq(irc_t *irc, const char *nick, const char *question, 163 163 const char *secret); 164 165 /* update flags within the irc_user structure to reflect OTR status of context */ 166 void otr_update_uflags(ConnContext *context, irc_user_t *u); 164 167 165 168 /* update op/voice flag of given user according to encryption state and settings … … 608 611 irc_user_t *u; 609 612 irc_t *irc = ic->bee->ui_data; 610 const char *trust;611 613 612 614 u = peeruser(irc, context->username, context->protocol); … … 618 620 } 619 621 620 trust = context->active_fingerprint->trust; 621 if(trust && trust[0]) 622 u->flags |= IRC_USER_OTR_ENCRYPTED | IRC_USER_OTR_TRUSTED; 623 else 624 u->flags = ( u->flags & ~IRC_USER_OTR_TRUSTED ) | IRC_USER_OTR_ENCRYPTED; 622 otr_update_uflags(context, u); 625 623 if(!otr_update_modeflags(irc, u)) 626 624 irc_usermsg(irc, "conversation with %s is now off the record", u->nick); … … 641 639 return; 642 640 } 643 u->flags &= ~( IRC_USER_OTR_ENCRYPTED | IRC_USER_OTR_TRUSTED);641 otr_update_uflags(context, u); 644 642 if(!otr_update_modeflags(irc, u)) 645 643 irc_usermsg(irc, "conversation with %s is now in the clear", u->nick); … … 660 658 return; 661 659 } 662 if(context->active_fingerprint->trust[0]) 663 u->flags |= IRC_USER_OTR_ENCRYPTED | IRC_USER_OTR_TRUSTED; 664 else 665 u->flags = ( u->flags & ~IRC_USER_OTR_TRUSTED ) | IRC_USER_OTR_ENCRYPTED; 660 661 otr_update_uflags(context, u); 666 662 if(!otr_update_modeflags(irc, u)) 667 663 irc_usermsg(irc, "otr connection with %s has been refreshed", u->nick); … … 1312 1308 } 1313 1309 1310 void otr_update_uflags(ConnContext *context, irc_user_t *u) 1311 { 1312 const char *trust; 1313 1314 if(context->active_fingerprint) { 1315 u->flags |= IRC_USER_OTR_ENCRYPTED; 1316 1317 trust = context->active_fingerprint->trust; 1318 if(trust && trust[0]) 1319 u->flags |= IRC_USER_OTR_TRUSTED; 1320 else 1321 u->flags &= ~IRC_USER_OTR_TRUSTED; 1322 } else { 1323 u->flags &= ~IRC_USER_OTR_ENCRYPTED; 1324 } 1325 } 1326 1314 1327 int otr_update_modeflags(irc_t *irc, irc_user_t *u) 1315 1328 {
Note: See TracChangeset
for help on using the changeset viewer.