Commit 5a24ecd0 authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Philipp Hörist
Browse files

Notifications: Add 'Mark as Read' feature

parent 32a5c0e9
......@@ -247,6 +247,16 @@ def on_open_event(_action, param):
dict_['account'], dict_['jid'], dict_['type_'])
def on_remove_event(_action, param):
dict_ = param.unpack()
account, jid, type_ = dict_['account'], dict_['jid'], dict_['type_']
event =, jid, type_), jid, event)
win = app.interface.msg_win_mgr.get_window(jid, account)
if win:
win.redraw_tab(win.get_control(jid, account))
# Other Actions
def toggle_ipython(_action, _param):
......@@ -490,6 +490,7 @@ def _get_account_actions(account):
('-update-motd', a.on_update_motd, 'online', 's'),
('-delete-motd', a.on_delete_motd, 'online', 's'),
('-open-event', a.on_open_event, 'always', 'a{sv}'),
('-remove-event', a.on_remove_event, 'always', 'a{sv}'),
('-import-contacts', a.on_import_contacts, 'online', 's'),
......@@ -195,11 +195,18 @@ def popup(self, event_type, jid, account, type_='', icon_name=None,
'type_': GLib.Variant('s', type_)}
variant_dict = GLib.Variant('a{sv}', dict_)
action = 'app.{}-open-event'.format(account)
#Button in notification
notification.add_button_with_target(_('Open'), action,
# Notification button
_('Open'), action, variant_dict)
action, variant_dict)
if event_type in (
_('New Message'),
_('New Private Message'),
_('New Group Chat Message')):
action = 'app.{}-remove-event'.format(account)
_('Mark as Read'), action, variant_dict)
# Only one notification per JID
if event_type == _('Contact Changed Status'):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment