diff --git a/src/common/events.py b/src/common/events.py index 99cd98cfc..dbadef033 100644 --- a/src/common/events.py +++ b/src/common/events.py @@ -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) diff --git a/src/gajim.py b/src/gajim.py index ea067cf34..864ebac1f 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -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)