# HG changeset patch # User souliane # Date 1413980365 -7200 # Node ID 4c6c61696ba09319e052376b0797861e4bad5694 # Parent c6380dd3060212d89218abb5c1fc759efe23852b plugin sec_otr: improvement when sending a message to a MUC diff -r c6380dd30602 -r 4c6c61696ba0 src/browser/sat_browser/plugin_sec_otr.py --- a/src/browser/sat_browser/plugin_sec_otr.py Wed Oct 22 14:17:17 2014 +0200 +++ b/src/browser/sat_browser/plugin_sec_otr.py Wed Oct 22 14:19:25 2014 +0200 @@ -464,7 +464,7 @@ def sendMessageTrigger(self, to_jid, msg, msg_type, extra): def cb(jid): otrctx = self.context_manager.getContextForUser(jid, start=False) - if otrctx is not None and msg_type != 'groupchat' and otrctx.state != otr.context.STATE_PLAINTEXT: + if otrctx is not None and otrctx.state != otr.context.STATE_PLAINTEXT: if otrctx.state == otr.context.STATE_ENCRYPTED: log.debug(u"encrypting message") otrctx.sendMessage(msg) @@ -476,10 +476,9 @@ log.debug(u"sending message unencrypted") self.host.bridge.call('sendMessage', (None, self.host.sendError), to_jid.full(), msg, '', msg_type, extra) - if msg_type != 'groupchat': - self.fixResource(to_jid, cb) - else: - cb(to_jid) + if msg_type == 'groupchat': + return True + self.fixResource(to_jid, cb) return False # interrupt the main process def presenceReceivedTrigger(self, entity, show, priority, statuses):