diff cagou/plugins/plugin_wid_contact_list.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 9e5f9f0cee48
children 520fd0f50233
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_contact_list.py	Sat Jan 26 20:24:48 2019 +0100
+++ b/cagou/plugins/plugin_wid_contact_list.py	Sat Jan 26 20:24:48 2019 +0100
@@ -117,18 +117,7 @@
         assert self.profile
         # XXX: for now clicking on an item launch the corresponding Chat widget
         #      behaviour should change in the future
-        try:
-            # FIXME: Q&D way to get chat plugin, should be replaced by a clean method
-            #        in host
-            plg_infos = [p for p in G.host.getPluggedWidgets()
-                         if 'chat' in p['import_name']][0]
-        except IndexError:
-            log.warning(u"No plugin widget found to display chat")
-        else:
-            factory = plg_infos['factory']
-            G.host.switchWidget(self, factory(plg_infos,
-                                              jid.JID(self.jid),
-                                              profiles=[self.profile]))
+        G.host.doAction(u'chat', jid.JID(self.jid), [self.profile])
 
     def getMenuChoices(self):
         choices = []