don't keep in mem notifications when we handle them Fixes #6891
This commit is contained in:
parent
77183740d6
commit
370c844f7b
|
@ -192,11 +192,14 @@ class NotificationResponseManager:
|
||||||
self.interface.connect_to_signal('NotificationClosed', self.on_closed)
|
self.interface.connect_to_signal('NotificationClosed', self.on_closed)
|
||||||
|
|
||||||
def on_action_invoked(self, id_, reason):
|
def on_action_invoked(self, id_, reason):
|
||||||
self.received.append((id_, time.time(), reason))
|
|
||||||
if id_ in self.pending:
|
if id_ in self.pending:
|
||||||
notification = self.pending[id_]
|
notification = self.pending[id_]
|
||||||
notification.on_action_invoked(id_, reason)
|
notification.on_action_invoked(id_, reason)
|
||||||
del self.pending[id_]
|
del self.pending[id_]
|
||||||
|
return
|
||||||
|
# got an action on popup that isn't handled yet? Maybe user clicked too
|
||||||
|
# fast. Remember it.
|
||||||
|
self.received.append((id_, time.time(), reason))
|
||||||
if len(self.received) > 20:
|
if len(self.received) > 20:
|
||||||
curt = time.time()
|
curt = time.time()
|
||||||
for rec in self.received:
|
for rec in self.received:
|
||||||
|
@ -410,9 +413,8 @@ class DesktopNotification:
|
||||||
self.notify_another_way(e)
|
self.notify_another_way(e)
|
||||||
|
|
||||||
def attach_by_id(self, id_):
|
def attach_by_id(self, id_):
|
||||||
self.id = id_
|
|
||||||
notification_response_manager.attach_to_interface()
|
notification_response_manager.attach_to_interface()
|
||||||
notification_response_manager.add_pending(self.id, self)
|
notification_response_manager.add_pending(id_, self)
|
||||||
|
|
||||||
def notify_another_way(self, e):
|
def notify_another_way(self, e):
|
||||||
gajim.log.debug('Error when trying to use notification daemon: %s' % \
|
gajim.log.debug('Error when trying to use notification daemon: %s' % \
|
||||||
|
|
Loading…
Reference in New Issue