diff src/browser/sat_browser/panels.py @ 581:1c1dbe03d3c6

browser_side: fixes issue while getting a chat state for a MUC occupant who already left
author souliane <souliane@mailoo.org>
date Mon, 20 Oct 2014 10:00:44 +0200
parents 79fbc20c786b
children 0a06cf833f5a
line wrap: on
line diff
--- a/src/browser/sat_browser/panels.py	Sun Oct 19 12:32:08 2014 +0200
+++ b/src/browser/sat_browser/panels.py	Mon Oct 20 10:00:44 2014 +0200
@@ -1335,13 +1335,15 @@
         @param state: the new chat state
         @param nick: None for one2one, the MUC user nick or ALL_OCCUPANTS
         """
-        if nick:
-            assert(self.type == 'group')
-            occupants = self.occupants_list.occupants_list.keys() if nick == C.ALL_OCCUPANTS else [nick]
+        if self.type == 'group':
+            assert(nick)
+            if nick == C.ALL_OCCUPANTS:
+                occupants = self.occupants_list.occupants_list.keys()
+            else:
+                occupants = [nick] if nick in self.occupants_list.occupants_list else []
             for occupant in occupants:
                 self.occupants_list.occupants_list[occupant].setState(state)
         else:
-            assert(self.type == 'one2one')
             self._state = state
             self.refreshTitle()
         self.state_machine.started = not not state  # start to send "composing" state from now