comparison src/cagou/plugins/plugin_wid_chat.py @ 41:7cac2d1a6f20

core: new getPluginInfo method to retrieve plugin info corresponding to filter(s)
author Goffi <goffi@goffi.org>
date Sun, 28 Aug 2016 16:11:07 +0200
parents 6cf08d0ee460
children 286865bc013a
comparison
equal deleted inserted replaced
40:a1ec6cb57a1b 41:7cac2d1a6f20
153 # TODO: check if plugin XEP-0045 is activated 153 # TODO: check if plugin XEP-0045 is activated
154 if "conference" in [i[0] for i in disco[1]]: 154 if "conference" in [i[0] for i in disco[1]]:
155 raise NotImplementedError(u"MUC not implemented yet") 155 raise NotImplementedError(u"MUC not implemented yet")
156 # G.host.bridge.MUCJoin(unicode(jid_), "", "", self.profile) 156 # G.host.bridge.MUCJoin(unicode(jid_), "", "", self.profile)
157 else: 157 else:
158 plugin_info = [p for p in G.host.getPluggedWidgets() if p["factory"] == self.factory][0] # FIXME: Q&D way, need a proper method in host 158 plugin_info = G.host.getPluginInfo(main=Chat)
159 factory = plugin_info['factory'] 159 factory = plugin_info['factory']
160 G.host.switchWidget(self, factory(plugin_info, jid_, profiles=[self.profile])) 160 G.host.switchWidget(self, factory(plugin_info, jid_, profiles=[self.profile]))
161 self.header_input.text = '' 161 self.header_input.text = ''
162 162
163 def discoEb(failure): 163 def discoEb(failure):