fix esession toggling
This commit is contained in:
		
							parent
							
								
									59f9d7dc2e
								
							
						
					
					
						commit
						908bf97fbc
					
				
					 3 changed files with 7 additions and 15 deletions
				
			
		|  | @ -2325,23 +2325,18 @@ class ChatControl(ChatControlBase): | |||
| 
 | ||||
| 	def _on_toggle_e2e_menuitem_activate(self, widget): | ||||
| 		if self.session and self.session.enable_encryption: | ||||
| 			jid = str(self.session.jid) | ||||
| 			thread_id = self.session.thread_id | ||||
| 
 | ||||
| 			self.session.terminate_e2e() | ||||
| 
 | ||||
| 			self.print_esession_details() | ||||
| 
 | ||||
| 			jid = str(self.session.jid) | ||||
| 
 | ||||
| 			gajim.connections[self.account].delete_session(jid, | ||||
| 				self.session.thread_id) | ||||
| 
 | ||||
| 			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): | ||||
|  |  | |||
|  | @ -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) | ||||
|  |  | |||
|  | @ -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) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue