diff src/browser/sat_browser/chat.py @ 663:423182fea41c frontends_multi_profiles

browser_side: fixes OTR using the new resource system and proper triggers (send and receive message) or listener (presence update)
author souliane <souliane@mailoo.org>
date Tue, 03 Mar 2015 07:21:50 +0100
parents ebb602d8b3f2
children 2201ff543a05
line wrap: on
line diff
--- a/src/browser/sat_browser/chat.py	Tue Mar 03 06:51:13 2015 +0100
+++ b/src/browser/sat_browser/chat.py	Tue Mar 03 07:21:50 2015 +0100
@@ -88,9 +88,7 @@
         self.vpanel.setSize('100%', '100%')
 
         # FIXME: temporary dirty initialization to display the OTR state
-        def header_info_cb(cb):
-            host.plugins['otr'].infoTextCallback(target, cb)
-        header_info = header_info_cb if (type_ == C.CHAT_ONE2ONE and 'otr' in host.plugins) else None
+        header_info = host.plugins['otr'].getInfoTextForUser(target) if (type_ == C.CHAT_ONE2ONE and 'otr' in host.plugins) else None
 
         libervia_widget.LiberviaWidget.__init__(self, host, title=unicode(target.bare), info=header_info, selectable=True)
         self._body = AbsolutePanel()
@@ -185,12 +183,12 @@
         return ("ONE2ONE" if self.type == C.CHAT_ONE2ONE else "GROUP", msg)
 
     def onTextEntered(self, text):
-        self.host.sendMessage(unicode(self.target),
+        self.host.sendMessage(self.target,
                               text,
-                              mess_type = C.MESS_TYPE_GROUPCHAT if self.type == C.CHAT_GROUP else C.MESS_TYPE_CHAT,
-                             errback=self.host.sendError,
-                             profile_key=C.PROF_KEY_NONE
-                             )
+                              mess_type=C.MESS_TYPE_GROUPCHAT if self.type == C.CHAT_GROUP else C.MESS_TYPE_CHAT,
+                              errback=self.host.sendError,
+                              profile_key=C.PROF_KEY_NONE
+                              )
         self.state_machine._onEvent("active")
 
     def onQuit(self):