Changeset 9569 for branches/session_centric/src/message_control.py
- Timestamp:
- 05/04/08 02:24:27 (7 months ago)
- Files:
-
- 1 modified
-
branches/session_centric/src/message_control.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/session_centric/src/message_control.py
r9308 r9569 118 118 119 119 def set_session(self, session): 120 if hasattr(self, 'session') and session == self.session: 120 oldsession = None 121 if hasattr(self, 'session'): 122 oldsession = self.session 123 124 if oldsession and session == oldsession: 121 125 return 122 123 was_encrypted = False124 125 if hasattr(self, 'session') and self.session:126 if self.session.enable_encryption:127 was_encrypted = True128 129 gajim.connections[self.account].delete_session(self.session.jid,130 self.session.thread_id)131 126 132 127 self.session = session … … 135 130 session.control = self 136 131 137 if was_encrypted: 138 self.print_esession_details() 132 if oldsession: 133 self.parent_win.change_thread_key(self.contact.jid, 134 self.account, oldsession.thread_id, session.thread_id) 135 136 if oldsession.enable_encryption: 137 self.print_esession_details() 139 138 140 139 def send_message(self, message, keyID = '', type = 'chat', … … 145 144 jid = self.contact.jid 146 145 147 if not self.session:148 print('uhoh new session')149 fjid = self.contact.get_full_jid()150 new_session = gajim.connections[self.account].make_new_session(fjid)151 152 self.set_session(new_session)153 154 146 # Send and update history 155 147 return gajim.connections[self.account].send_message(jid, message, keyID,
