diff --git a/src/common/events.py b/src/common/events.py index f51d64fb4..5179bcac5 100644 --- a/src/common/events.py +++ b/src/common/events.py @@ -219,10 +219,12 @@ class Events: events_list.append(ev) return events_list - def get_first_event(self, account, jid = None, type_ = None): + def get_first_event(self, account=None, jid=None, type_=None): """ Return the first event of type type_ if given """ + if not account: + return self._get_first_event_with_attribute(self._events) events_list = self.get_events(account, jid, type_) # be sure it's bigger than latest event first_event_time = time.time() + 1 diff --git a/src/remote_control.py b/src/remote_control.py index 7f47b94c3..f6cb2c408 100644 --- a/src/remote_control.py +++ b/src/remote_control.py @@ -594,7 +594,10 @@ class SignalObject(dbus.service.Object): Show the window(s) with next pending event in tabbed/group chats """ if gajim.events.get_nb_events(): - gajim.interface.systray.handle_first_event() + account, jid, event = gajim.events.get_first_event() + if not event: + return + gajim.interface.handle_event(account, jid, event.type_) @dbus.service.method(INTERFACE, in_signature='s', out_signature='a{sv}') def contact_info(self, jid):