change resource of incoming event when a resource disconected between the moment we get the message and the moment we read it. see #2657

This commit is contained in:
Yann Leboulanger 2006-11-21 20:26:44 +00:00
parent 1377aa875c
commit 43c2f2f0ab
2 changed files with 11 additions and 0 deletions

View File

@ -118,6 +118,15 @@ class Events:
if gajim.interface.systray_capabilities:
gajim.interface.systray.set_img()
def change_jid(self, account, old_jid, new_jid):
if not self._events[account].has_key(old_jid):
return
if self._events[account].has_key(new_jid):
self._events[account][new_jid] += self._events[account][old_jid]
else:
self._events[account][new_jid] = self._events[account][old_jid]
del self._events[account][old_jid]
def get_nb_events(self, types = [], account = None):
return self._get_nb_events(types = types, account = account)

View File

@ -1804,6 +1804,8 @@ class Interface:
# message and is now higher because the other one is offline
if resource and highest_contact.resource == resource and \
not self.msg_win_mgr.has_window(jid, account):
# remove resource of events too
gajim.events.change_jid(account, fjid, jid)
resource = None
fjid = jid
contact = gajim.contacts.get_contact(account, jid, resource)