Mercurial > libervia-web
comparison 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 |
comparison
equal
deleted
inserted
replaced
580:79fbc20c786b | 581:1c1dbe03d3c6 |
---|---|
1333 to set the state for a one2one conversation, or give a nickname or | 1333 to set the state for a one2one conversation, or give a nickname or |
1334 C.ALL_OCCUPANTS to set the state of a participant within a MUC. | 1334 C.ALL_OCCUPANTS to set the state of a participant within a MUC. |
1335 @param state: the new chat state | 1335 @param state: the new chat state |
1336 @param nick: None for one2one, the MUC user nick or ALL_OCCUPANTS | 1336 @param nick: None for one2one, the MUC user nick or ALL_OCCUPANTS |
1337 """ | 1337 """ |
1338 if nick: | 1338 if self.type == 'group': |
1339 assert(self.type == 'group') | 1339 assert(nick) |
1340 occupants = self.occupants_list.occupants_list.keys() if nick == C.ALL_OCCUPANTS else [nick] | 1340 if nick == C.ALL_OCCUPANTS: |
1341 occupants = self.occupants_list.occupants_list.keys() | |
1342 else: | |
1343 occupants = [nick] if nick in self.occupants_list.occupants_list else [] | |
1341 for occupant in occupants: | 1344 for occupant in occupants: |
1342 self.occupants_list.occupants_list[occupant].setState(state) | 1345 self.occupants_list.occupants_list[occupant].setState(state) |
1343 else: | 1346 else: |
1344 assert(self.type == 'one2one') | |
1345 self._state = state | 1347 self._state = state |
1346 self.refreshTitle() | 1348 self.refreshTitle() |
1347 self.state_machine.started = not not state # start to send "composing" state from now | 1349 self.state_machine.started = not not state # start to send "composing" state from now |
1348 | 1350 |
1349 def refreshTitle(self): | 1351 def refreshTitle(self): |