Send thread ID on ending OTR session so that self.session is defined

when that event is received and the lock icon updated.
This commit is contained in:
js 2008-05-19 20:04:48 +00:00
parent b0aeefcbb5
commit f92f5f5c64
2 changed files with 12 additions and 7 deletions

View file

@ -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)

View file

@ -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