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:
souliane 2015-03-24 17:31:08 +01:00
commit 78f14091b1

View file

@ -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