quick_frontend, primitivus: remove QuickChat.updateEntityState and QuickChat.setContactStates, use more general QuickChat.update (also called when joining the room to initialise the occupants list)
This commit is contained in:
parent
1a03845539
commit
78f14091b1
1 changed files with 96 additions and 54 deletions
|
|
@ -59,12 +59,11 @@ class RoomGame(object):
|
|||
chat_widget.visible_states.append(cls._game_name)
|
||||
symbols = games.SYMBOLS[cls._game_name]
|
||||
index = 0
|
||||
contact_list = host.contact_lists[profile]
|
||||
for occupant in chat_widget.occupants:
|
||||
occupant_jid = jid.newResource(room_jid, occupant)
|
||||
if occupant in players:
|
||||
chat_widget.updateEntityState(occupant_jid, cls._game_name, symbols[index % len(symbols)])
|
||||
else:
|
||||
chat_widget.updateEntityState(occupant_jid, cls._game_name, None)
|
||||
contact_list.setCache(occupant_jid, cls._game_name, symbols[index % len(symbols)] if occupant in players else None)
|
||||
chat_widget.update(occupant_jid)
|
||||
|
||||
if suffix == "Players" or chat_widget.nick not in players:
|
||||
return # waiting for other players to join, or not playing
|
||||
|
|
|
|||
Loading…
Reference in a new issue