From 37b6f7058aabfd7ab2d161fc6e1add932df85909 Mon Sep 17 00:00:00 2001 From: js Date: Thu, 29 May 2008 18:42:58 +0000 Subject: [PATCH] [Kjell Braden] Fix OTR SMP. --- src/common/connection_handlers.py | 22 +++++++++++----------- src/otr_windows.py | 9 +++++++-- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 04d633ecb..e6bc37b55 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -1694,17 +1694,17 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, for ctrl in ctrls: ctrl.update_otr() - ctx = gajim.otr_module. \ - otrl_context_find( - self.otr_userstates, - frm.encode(), - gajim.get_jid_from_account( - self.name).encode(), - gajim.OTR_PROTO, 1, - (gajim.otr_add_appdata, - self.name))[0] - tlvs = otr_msg_tuple[2] - ctx.app_data.handle_tlv(tlvs) + ctx = gajim.otr_module. \ + otrl_context_find( + self.otr_userstates, + frm.encode(), + gajim.get_jid_from_account( + self.name).encode(), + gajim.OTR_PROTO, 1, + (gajim.otr_add_appdata, + self.name))[0] + tlvs = otr_msg_tuple[2] + ctx.app_data.handle_tlv(tlvs) if msgtxt == '': return diff --git a/src/otr_windows.py b/src/otr_windows.py index c0d24d00d..2b3c5ab18 100644 --- a/src/otr_windows.py +++ b/src/otr_windows.py @@ -68,6 +68,11 @@ class ContactOtrSMPWindow: self.smp_running = False self.finished = False + self.gw('smp_cancel_button').set_sensitive(True) + self.gw('smp_ok_button').set_sensitive(True) + self.gw('progressbar').set_fraction(0) + self.gw('secret_entry').set_text('') + self.response = response if response: self.gw('desc_label').set_markup(_('%s is trying ' \ @@ -104,7 +109,7 @@ class ContactOtrSMPWindow: self.gw('desc_label').set_markup(text) for ctrl in gajim.interface.msg_win_mgr.get_chat_controls( self.contact.jid, self.account): - ctrl.update_otr() + ctrl.update_otr(True) gajim.otr_ui_ops.write_fingerprints({'account': self.account}) def handle_tlv(self, tlvs): @@ -310,7 +315,7 @@ class ContactOtrWindow: self.ctrl = gajim.interface.msg_win_mgr.get_control( self.contact.jid, self.account) if self.ctrl: - self.ctrl.update_otr() + self.ctrl.update_otr(True) if self.gw('otr_default_checkbutton').get_active(): # default is enabled, so remove any user-specific