diff src/plugins/plugin_misc_tarot.py @ 1970:200cd707a46d

plugin XEP-0045, quick_frontend + primitivus (chat): cleaning of XEP-0045 (first pass): - bridge methods/signals now all start with "muc" to follow new convention - internal method use client instead of profile to follow new convention - removed excetpions from plugin XEP-0045 in favor of core.exceptions, NotReady added - cleaned/simplified several part of the code. checkClient removed as it is not needed anymore - self.clients map removed, muc data are now stored directly in client - getRoomEntityNick and getRoomNicksOfUsers are removed as they don't look sane. /!\ This break all room game plugins for the moment - use of uuid4 instead of uuid1 for getUniqueName, as host ID and current time are used for uuid1
author Goffi <goffi@goffi.org>
date Mon, 27 Jun 2016 21:45:11 +0200
parents 2daf7b4c6756
children 33c8c4973743
line wrap: on
line diff
--- a/src/plugins/plugin_misc_tarot.py	Fri Jun 24 22:41:28 2016 +0200
+++ b/src/plugins/plugin_misc_tarot.py	Mon Jun 27 21:45:11 2016 +0200
@@ -477,9 +477,10 @@
         """
         @param mess_elt: instance of twisted.words.xish.domish.Element
         """
+        client = self.host.getClient(profile)
         from_jid = jid.JID(mess_elt['from'])
         room_jid = jid.JID(from_jid.userhost())
-        nick = self.host.plugins["XEP-0045"].getRoomNick(room_jid, profile)
+        nick = self.host.plugins["XEP-0045"].getRoomNick(client, room_jid)
 
         game_elt = mess_elt.firstChildElement()
         game_data = self.games[room_jid]
@@ -522,7 +523,7 @@
                 # TODO: use proper XEP-0004 way for answering form
                 player = elt['player']
                 players_data[player]['contrat'] = unicode(elt)
-                contrats = [players_data[player]['contrat'] for player in game_data['players']]
+                contrats = [players_data[p]['contrat'] for p in game_data['players']]
                 if contrats.count(None):
                     # not everybody has choosed his contrat, it's next one turn
                     player = self.__next_player(game_data)