From f92f5f5c64e5385f0fe7afcdba8acdaa31ba6c3c Mon Sep 17 00:00:00 2001 From: js Date: Mon, 19 May 2008 20:04:48 +0000 Subject: [PATCH] Send thread ID on ending OTR session so that self.session is defined when that event is received and the lock icon updated. --- src/chat_control.py | 16 +++++++++------- src/gajim.py | 3 +++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index 698c92474..cb818ce92 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -2402,15 +2402,17 @@ class ChatControl(ChatControlBase): def _on_start_otr_menuitem_activate(self, widget): # ?OTR? gets replaced with a better message internally in otrl_message_sending - MessageControl.send_message(self, u"?OTR?", type="chat") + MessageControl.send_message(self, u'?OTR?', type='chat') def _on_end_otr_menuitem_activate(self, widget): fjid = self.contact.get_full_jid() - gajim.otr_module.otrl_message_disconnect(gajim.connections[self.account].otr_userstates, - (gajim.otr_ui_ops, {'account':self.account,'urgent':True}), - gajim.get_jid_from_account(self.account).encode(), gajim.OTR_PROTO, - fjid.encode()) - gajim.otr_ui_ops.gajim_log("Private conversation with %s lost."%fjid, - self.account, fjid.encode()) + gajim.otr_module.otrl_message_disconnect( + self.session.conn.otr_userstates, + (gajim.otr_ui_ops, {'account': self.account, + 'urgent': True, 'session': self.session}), + gajim.get_jid_from_account(self.account).encode(), + gajim.OTR_PROTO, fjid.encode()) + gajim.otr_ui_ops.gajim_log(_('Private conversation with ' \ + '%s lost.') % fjid, self.account, fjid.encode()) self.update_otr() def _on_otr_settings_menuitem_activate(self, widget): gajim.otr_windows.ContactOtrWindow(self.contact, self.account, self) diff --git a/src/gajim.py b/src/gajim.py index d79db8c53..8a5b00d65 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -375,6 +375,9 @@ class OtrlMessageAppOps: # disconnect from OTR sessions before quitting stanza = XmppMessage(to = recipient, body = message, typ='chat') + if 'session' in opdata: + stanza.setThread(opdata['session'].thread_id) + gajim.connections[opdata['account']].connection. \ send(stanza, now = True) return