diff libervia.py @ 279:2d6bd975a72d

browser_side: set your own presence status and display those of others
author souliane <souliane@mailoo.org>
date Sat, 23 Nov 2013 14:46:03 +0100
parents aebb96bfa8d1
children 1ccdc34cfb60
line wrap: on
line diff
--- a/libervia.py	Fri Nov 22 21:43:08 2013 +0100
+++ b/libervia.py	Sat Nov 23 14:46:03 2013 +0100
@@ -161,7 +161,7 @@
         self.bridge = BridgeCall()
         self.bridge_signals = BridgeSignals(self)
         self.uni_box = None
-        self.status_panel = panels.StatusPanel(self)
+        self.status_panel = panels.PresenceStatusPanel(self)
         self.contact_panel = ContactPanel(self)
         self.panel = panels.MainPanel(self)
         self.discuss_panel = self.panel.discuss_panel
@@ -577,6 +577,7 @@
         _entity = JID(entity)
         #XXX: QnD way to get our status
         if self.whoami and self.whoami.bare == _entity.bare and statuses:
+            self.status_panel.setPresence(show)
             self.status_panel.changeStatus(statuses.values()[0])
         if (not self.whoami or self.whoami.bare != _entity.bare):
             self.contact_panel.setConnected(_entity.bare, _entity.resource, show, priority, statuses)
@@ -738,7 +739,7 @@
             elif type_ == "COMMENT":
                 self.bridge.call("sendMblogComment", None, entities, text, extra)
             elif type_ == "STATUS":
-                self.bridge.call('setStatus', None, text)
+                self.bridge.call('setStatus', None, self.status_panel.presence, text)
             elif type_ in ("groupchat", "chat"):
                 self.bridge.call('sendMessage', None, entities, text, '', type_, extra)
             else: