diff frontends/src/quick_frontend/quick_games.py @ 1388:a025242bebe7

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)
author souliane <souliane@mailoo.org>
date Tue, 24 Mar 2015 17:31:08 +0100
parents da2ea16fabc6
children 069ad98b360d
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_games.py	Tue Mar 24 10:46:42 2015 +0100
+++ b/frontends/src/quick_frontend/quick_games.py	Tue Mar 24 17:31:08 2015 +0100
@@ -59,12 +59,11 @@
             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