try to improve behavour with contacs connected with several resources

This commit is contained in:
Yann Leboulanger 2012-08-20 14:49:29 +02:00
parent aaccec79cf
commit e8426d4cef
2 changed files with 2 additions and 8 deletions

View File

@ -375,7 +375,7 @@ class Interface:
is_highest = (highest and highest.resource == resource)
ctrl = self.msg_win_mgr.get_control(jid, account)
if ctrl and ctrl.session and ctrl.session.resource == resource:
if ctrl and ctrl.session and len(obj.contact_list) > 1:
ctrl.remove_session(ctrl.session)
def handle_event_msgerror(self, obj):

View File

@ -60,7 +60,6 @@ class MessageControl(object):
self.resource = resource
self.session = None
self.other_sessions = []
gajim.last_message_time[self.account][self.get_full_jid()] = 0
@ -203,10 +202,6 @@ class MessageControl(object):
if oldsession:
oldsession.control = None
self.other_sessions.append(oldsession)
if self.session in self.other_sessions:
self.other_sessions.remove(self.session)
crypto_changed = bool(session and isinstance(session,
EncryptedStanzaSession) and session.enable_encryption) != \
@ -229,8 +224,7 @@ class MessageControl(object):
last_session = self.other_sessions.pop(0)
if session not in self.other_sessions:
self.other_sessions.append(session)
if last_session:
self.session = last_session
self.session = last_session
def _nec_message_outgoing(self, obj):
# Send the given message to the active tab.