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:
parent
1377aa875c
commit
43c2f2f0ab
|
@ -118,6 +118,15 @@ class Events:
|
||||||
if gajim.interface.systray_capabilities:
|
if gajim.interface.systray_capabilities:
|
||||||
gajim.interface.systray.set_img()
|
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):
|
def get_nb_events(self, types = [], account = None):
|
||||||
return self._get_nb_events(types = types, account = account)
|
return self._get_nb_events(types = types, account = account)
|
||||||
|
|
||||||
|
|
|
@ -1804,6 +1804,8 @@ class Interface:
|
||||||
# message and is now higher because the other one is offline
|
# message and is now higher because the other one is offline
|
||||||
if resource and highest_contact.resource == resource and \
|
if resource and highest_contact.resource == resource and \
|
||||||
not self.msg_win_mgr.has_window(jid, account):
|
not self.msg_win_mgr.has_window(jid, account):
|
||||||
|
# remove resource of events too
|
||||||
|
gajim.events.change_jid(account, fjid, jid)
|
||||||
resource = None
|
resource = None
|
||||||
fjid = jid
|
fjid = jid
|
||||||
contact = gajim.contacts.get_contact(account, jid, resource)
|
contact = gajim.contacts.get_contact(account, jid, resource)
|
||||||
|
|
Loading…
Reference in New Issue