diff cagou/plugins/plugin_wid_chat.py @ 250:ff1efdeff53f

core: notifs can now have a custom icon and be clickable: - new host.doAction method, to open a specific widget/target (chat only for now) - when adding a notif, symbol can now be specified - an action can be linked to a notification - notifs design improvments - plugins contact list and chat use the new doAction/notif action - if None is given as old widget in SwitchWidget, the new getWidgetToSwitch method is used to select one to switch.
author Goffi <goffi@goffi.org>
date Sat, 26 Jan 2019 20:24:48 +0100
parents 5bd94bc08f5c
children 145c29b5f2b5
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_chat.py	Sat Jan 26 20:24:48 2019 +0100
+++ b/cagou/plugins/plugin_wid_chat.py	Sat Jan 26 20:24:48 2019 +0100
@@ -527,14 +527,24 @@
                 if not is_visible:
                     G.host.addNote(
                         _(u"private message"),
-                        notif_msg
+                        notif_msg,
+                        symbol = u"chat",
+                        action = {
+                            "action": u'chat',
+                            "target": self.target,
+                            "profiles": self.profiles}
                         )
         else:
             if mess_data.mention and not mess_data.history:
                 notif_msg = self._get_notif_msg(mess_data)
                 G.host.addNote(
                     _(u"mention"),
-                    notif_msg
+                    notif_msg,
+                    symbol = u"chat",
+                    action = {
+                        "action": u'chat',
+                        "target": self.target,
+                        "profiles": self.profiles}
                     )
                 if not Window.focus:
                     G.host.desktop_notif(