diff frontends/quick_frontend/quick_app.py @ 85:fc7583282d40

Tarot Game plugin: first draft - SàT: beginning of the plugin - Tarot Plugin: 1 method createTarotGame et 1 signal tarotGameStarted - wix: added "Game" menu in group chat to start Tarot game
author Goffi <goffi@goffi.org>
date Fri, 07 May 2010 17:09:30 +0930
parents db0a0f000e37
children 4b5f2d55b6ac
line wrap: on
line diff
--- a/frontends/quick_frontend/quick_app.py	Thu May 06 20:47:48 2010 +0930
+++ b/frontends/quick_frontend/quick_app.py	Fri May 07 17:09:30 2010 +0930
@@ -46,6 +46,7 @@
         self.bridge.register("roomUserJoined", self.roomUserJoined)
         self.bridge.register("roomUserLeft", self.roomUserLeft)
         self.bridge.register("roomNewSubject", self.roomNewSubject)
+        self.bridge.register("tarotGameStarted", self.tarotGameStarted)
         self.bridge.register("subscribe", self.subscribe)
         self.bridge.register("paramUpdate", self.paramUpdate)
         self.bridge.register("contactDeleted", self.contactDeleted)
@@ -215,6 +216,7 @@
         room_jid=room_id+'@'+room_service
         self.chat_wins[room_jid].setUserNick(user_nick)
         self.chat_wins[room_jid].setType("group")
+        self.chat_wins[room_jid].id = room_jid
         self.chat_wins[room_jid].setPresents([user_nick]+room_nicks)
 
 
@@ -244,6 +246,11 @@
         if self.chat_wins.has_key(room_jid):
             self.chat_wins[room_jid].setSubject(subject)
             debug (_("new subject for room [%(room_jid)s]: %(subject)s") % {'room_jid':room_jid, "subject":subject})
+    
+    def tarotGameStarted(self, room_jid, players, profile):
+        if not self.__check_profile(profile):
+            return
+        print "Tarot Game Started \o/"
         
 
     def subscribe(self, type, raw_jid, profile):