diff frontends/src/quick_frontend/quick_app.py @ 372:f964dcec1611

core: plugins refactored according to bridge + updatedValue now use profile
author Goffi <goffi@goffi.org>
date Wed, 06 Jul 2011 01:06:18 +0200
parents 0806a65a5fa9
children 10b4f577d0c0
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_app.py	Wed Jul 06 01:04:24 2011 +0200
+++ b/frontends/src/quick_frontend/quick_app.py	Wed Jul 06 01:06:18 2011 +0200
@@ -51,33 +51,33 @@
         self.bridge.register("newMessage", self.newMessage)
         self.bridge.register("newAlert", self.newAlert)
         self.bridge.register("presenceUpdate", self.presenceUpdate)
-        self.bridge.register("roomJoined", self.roomJoined)
-        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("tarotGameNew", self.tarotGameNew)
-        self.bridge.register("tarotGameChooseContrat", self.tarotChooseContrat)
-        self.bridge.register("tarotGameShowCards", self.tarotShowCards)
-        self.bridge.register("tarotGameYourTurn", self.tarotMyTurn)
-        self.bridge.register("tarotGameScore", self.tarotScore)
-        self.bridge.register("tarotGameCardsPlayed", self.tarotCardsPlayed)
-        self.bridge.register("tarotGameInvalidCards", self.tarotInvalidCards)
-        self.bridge.register("quizGameStarted", self.quizGameStarted)
-        self.bridge.register("quizGameNew", self.quizGameNew)
-        self.bridge.register("quizGameQuestion", self.quizGameQuestion)
-        self.bridge.register("quizGamePlayerBuzzed", self.quizGamePlayerBuzzed)
-        self.bridge.register("quizGamePlayerSays", self.quizGamePlayerSays)
-        self.bridge.register("quizGameAnswerResult", self.quizGameAnswerResult)
-        self.bridge.register("quizGameTimerExpired", self.quizGameTimerExpired)
-        self.bridge.register("quizGameTimerRestarted", self.quizGameTimerRestarted)
         self.bridge.register("subscribe", self.subscribe)
         self.bridge.register("paramUpdate", self.paramUpdate)
         self.bridge.register("contactDeleted", self.contactDeleted)
-        self.bridge.register("updatedValue", self.updatedValue, "request")
-        self.bridge.register("askConfirmation", self.askConfirmation, "request")
-        self.bridge.register("actionResult", self.actionResult, "request")
-        self.bridge.register("actionResultExt", self.actionResult, "request")
+        self.bridge.register("updatedValue", self.updatedValue)
+        self.bridge.register("askConfirmation", self.askConfirmation)
+        self.bridge.register("actionResult", self.actionResult)
+        self.bridge.register("actionResultExt", self.actionResult)
+        self.bridge.register("roomJoined", self.roomJoined, "plugin")
+        self.bridge.register("roomUserJoined", self.roomUserJoined, "plugin")
+        self.bridge.register("roomUserLeft", self.roomUserLeft, "plugin")
+        self.bridge.register("roomNewSubject", self.roomNewSubject, "plugin")
+        self.bridge.register("tarotGameStarted", self.tarotGameStarted, "plugin")
+        self.bridge.register("tarotGameNew", self.tarotGameNew, "plugin")
+        self.bridge.register("tarotGameChooseContrat", self.tarotChooseContrat, "plugin")
+        self.bridge.register("tarotGameShowCards", self.tarotShowCards, "plugin")
+        self.bridge.register("tarotGameYourTurn", self.tarotMyTurn, "plugin")
+        self.bridge.register("tarotGameScore", self.tarotScore, "plugin")
+        self.bridge.register("tarotGameCardsPlayed", self.tarotCardsPlayed, "plugin")
+        self.bridge.register("tarotGameInvalidCards", self.tarotInvalidCards, "plugin")
+        self.bridge.register("quizGameStarted", self.quizGameStarted, "plugin")
+        self.bridge.register("quizGameNew", self.quizGameNew, "plugin")
+        self.bridge.register("quizGameQuestion", self.quizGameQuestion, "plugin")
+        self.bridge.register("quizGamePlayerBuzzed", self.quizGamePlayerBuzzed, "plugin")
+        self.bridge.register("quizGamePlayerSays", self.quizGamePlayerSays, "plugin")
+        self.bridge.register("quizGameAnswerResult", self.quizGameAnswerResult, "plugin")
+        self.bridge.register("quizGameTimerExpired", self.quizGameTimerExpired, "plugin")
+        self.bridge.register("quizGameTimerRestarted", self.quizGameTimerRestarted, "plugin")
         
         self.current_action_ids = set()
         self.current_action_ids_cb = {}
@@ -488,7 +488,9 @@
         except KeyError:
             pass
 
-    def updatedValue(self, name, data):
+    def updatedValue(self, name, data, profile):
+        if not self.check_profile(profile):
+            return
         if name == "card_nick":
             target = JID(data['jid'])
             if target in self.contactList: