From 65d5d9208735d94016639c23cfa8834883d82f23 Mon Sep 17 00:00:00 2001 From: js Date: Tue, 22 Jul 2008 14:32:37 +0000 Subject: [PATCH] * End ESession when remote signs off. * Fix typo. * Better code in conversation_textview.py. @bct: Your diff didn't work, I had to move it + add an if. Seems to work now. --- src/conversation_textview.py | 14 ++++---------- src/gajim.py | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/conversation_textview.py b/src/conversation_textview.py index 946fc0591..25199f162 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -397,11 +397,8 @@ class ConversationTextview: self.smooth_scroll_timer.cancel() def show_xep0184_warning(self, id): - try: - if self.xep0184_marks[id] is not None: - return - except KeyError: - pass + if self.xep0184_marks.has_key(id): + return buffer = self.tv.get_buffer() buffer.begin_user_action() @@ -427,10 +424,7 @@ class ConversationTextview: buffer.end_user_action() def hide_xep0184_warning(self, id): - try: - if self.xep0184_marks[id] is None: - return - except KeyError: + if not self.xep0184_marks.has_key(id): return if self.xep0184_shown[id] == NOT_SHOWN: @@ -452,7 +446,7 @@ class ConversationTextview: buffer.end_user_action() - self.xep0184_marks[id] = None + del self.xep0184_marks[id] del self.xep0184_shown[id] def show_focus_out_line(self): diff --git a/src/gajim.py b/src/gajim.py index d3ed10e8a..9c2863a84 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -773,6 +773,22 @@ class Interface: # resource signs off! gajim.connections[account]. \ remove_transfers_for_contact(contact1) + + # disable encryption, since if any messages are + # lost they'll be not decryptable (note that + # this contradicts XEP-0201 - trying to get the + # in the XEP, though) + if gajim.connections[account].sessions. \ + has_key(ji): + for sess in gajim.connections \ + [account]. sessions[ji].values(): + if sess.enable_encryption: + sess.terminate_e2e() + gajim.connections \ + [account]. \ + delete_session(jid, + sess.thread_id) + self.roster.chg_contact_status(contact1, array[1], status_message, account) # Notifications @@ -786,7 +802,7 @@ class Interface: elif old_show > 1 and new_show < 2: notify.notify('contact_disconnected', jid, - ccount, status_message) + account, status_message) if self.remote_ctrl: self.remote_ctrl.raise_signal( 'ContactAbsence',