# HG changeset patch # User Goffi # Date 1486302921 -3600 # Node ID 4e67d6ffea665b691c76488f962e508e5c1a7720 # Parent f4525005284635d0a4966ab6bab2025c974a3f77 quick app: check type in notify diff -r f45250052846 -r 4e67d6ffea66 frontends/src/quick_frontend/constants.py --- a/frontends/src/quick_frontend/constants.py Sun Feb 05 14:55:21 2017 +0100 +++ b/frontends/src/quick_frontend/constants.py Sun Feb 05 14:55:21 2017 +0100 @@ -86,7 +86,8 @@ LISTENERS = {'avatar', 'nick', 'presence', 'profilePlugged', 'disconnect', 'gotMenus', 'menu', 'notification', 'notificationsClear', 'progressFinished', 'progressError'} # Notifications - NOTIFY_MESSAGE = 'MESSAGE' # a message was received - NOTIFY_MENTION = 'MENTION' # user was mentionned + NOTIFY_MESSAGE = 'MESSAGE' # a message has been received + NOTIFY_MENTION = 'MENTION' # user has been mentionned NOTIFY_PROGRESS_END = 'PROGRESS_END' # a progression has finised NOTIFY_GENERIC = 'GENERIC' # a notification which has not its own type + NOTIFY_ALL = (NOTIFY_MESSAGE, NOTIFY_MENTION, NOTIFY_PROGRESS_END, NOTIFY_GENERIC) diff -r f45250052846 -r 4e67d6ffea66 frontends/src/quick_frontend/quick_app.py --- a/frontends/src/quick_frontend/quick_app.py Sun Feb 05 14:55:21 2017 +0100 +++ b/frontends/src/quick_frontend/quick_app.py Sun Feb 05 14:55:21 2017 +0100 @@ -636,6 +636,7 @@ @param cb_args(list, None): list of args for callback @param widget(object, None): widget where the notification happened """ + assert type_ in C.NOTIFY_ALL notif_dict = self.profiles[profile].notifications key = '' if entity is None else entity.bare type_notifs = notif_dict.setdefault(key, {}).setdefault(type_, [])