diff src/browser/sat_browser/base_panels.py @ 573:12823bcbd05b

browser_side: display MUC occupants presences
author souliane <souliane@mailoo.org>
date Fri, 17 Oct 2014 13:26:33 +0200
parents c97fe4059f71
children e1a773a64fb6
line wrap: on
line diff
--- a/src/browser/sat_browser/base_panels.py	Fri Oct 17 10:44:06 2014 +0200
+++ b/src/browser/sat_browser/base_panels.py	Fri Oct 17 13:26:33 2014 +0200
@@ -71,7 +71,7 @@
         @param state: the user chate state (XEP-0085)
         @param special: a string of symbols (e.g: for activities)
         """
-        HTML.__init__(self)
+        HTML.__init__(self, StyleName="occupant")
         self.nick = nick
         self._state = state
         self.special = special
@@ -101,7 +101,7 @@
     def _refresh(self):
         state = (' %s' % C.MUC_USER_STATES[self._state]) if self._state else ''
         special = "" if len(self.special) == 0 else " %s" % self.special
-        self.setHTML("<div class='occupant'>%s%s%s</div>" % (html_tools.html_sanitize(self.nick), special, state))
+        self.setHTML("%s%s%s" % (html_tools.html_sanitize(self.nick), special, state))
 
 
 class OccupantsList(AbsolutePanel):
@@ -123,6 +123,13 @@
         except KeyError:
             log.error("trying to remove an unexisting nick")
 
+    def getOccupantBox(self, nick):
+        """Get the widget element of the given nick.
+
+        @return: Occupant
+        """
+        return self.occupants_list[nick]
+
     def clear(self):
         self.occupants_list.clear()
         AbsolutePanel.clear(self)