diff --git a/src/chat_control.py b/src/chat_control.py index 2ec9cd477d2647c23764e9096ff1e71a2883376d..64a906af4a25f1e72f8a3a0a71ef1c8bd0cf4ec3 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -2325,23 +2325,18 @@ class ChatControl(ChatControlBase): def _on_toggle_e2e_menuitem_activate(self, widget): if self.session and self.session.enable_encryption: - self.session.terminate_e2e() - - self.print_esession_details() - jid = str(self.session.jid) + thread_id = self.session.thread_id - gajim.connections[self.account].delete_session(jid, - self.session.thread_id) + self.session.terminate_e2e() - self.set_session(gajim.connections[self.account].make_new_session(jid)) + gajim.connections[self.account].delete_session(jid, thread_id) else: if not self.session: fjid = self.contact.get_full_jid() new_sess = gajim.connections[self.account].make_new_session(fjid) self.set_session(new_sess) - # XXX decide whether to use 4 or 3 message negotiation self.session.negotiate_e2e(False) def got_connected(self): diff --git a/src/dialogs.py b/src/dialogs.py index 3bff3c7ce6158cb6056343203563a61d382e660a..5e771780b9090d2a8cafc85d9231562fedf1b70e 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -3818,7 +3818,7 @@ class ESessionInfoWindow: def on_verify_now_button_clicked(self, widget): pritext = _('''Have you verified the remote contact's identity?''') - sectext = _('''To prevent a man-in-the-middle attack, you should speak to this person directly (in person or on the phone) and verify that they see the same SAS as you.\n\nThis session's SAS: %s''') % self.session.sas + sectext = _('''To prevent a man-in-the-middle attack, you should speak to %s directly (in person or on the phone) and verify that they see the same SAS as you.\n\nThis session's SAS: <b>%s<b>''') % (self.session.jid, self.session.sas) sectext += '\n\n' + _('Did you talk to the remote contact and verify the SAS?') dialog = YesNoDialog(pritext, sectext) diff --git a/src/session.py b/src/session.py index 5016e3d5abcbf5d3d6f6726d6eeab6723c5db0c2..8951b5e2d453c64ff0866703465e8030549e73cc 100644 --- a/src/session.py +++ b/src/session.py @@ -21,14 +21,11 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession): self.control = None def acknowledge_termination(self): - stanza_session.EncryptedStanzaSession.acknowledge_termination(self) - if self.control: - if self.enable_encryption: - self.control.print_esession_details() - self.control.set_session(None) + stanza_session.EncryptedStanzaSession.acknowledge_termination(self) + def terminate(self): stanza_session.EncryptedStanzaSession.terminate(self)