comparison 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
comparison
equal deleted inserted replaced
371:3ea41a199b36 372:f964dcec1611
49 self.bridge.register("connectionError", self.connectionError) 49 self.bridge.register("connectionError", self.connectionError)
50 self.bridge.register("newContact", self.newContact) 50 self.bridge.register("newContact", self.newContact)
51 self.bridge.register("newMessage", self.newMessage) 51 self.bridge.register("newMessage", self.newMessage)
52 self.bridge.register("newAlert", self.newAlert) 52 self.bridge.register("newAlert", self.newAlert)
53 self.bridge.register("presenceUpdate", self.presenceUpdate) 53 self.bridge.register("presenceUpdate", self.presenceUpdate)
54 self.bridge.register("roomJoined", self.roomJoined)
55 self.bridge.register("roomUserJoined", self.roomUserJoined)
56 self.bridge.register("roomUserLeft", self.roomUserLeft)
57 self.bridge.register("roomNewSubject", self.roomNewSubject)
58 self.bridge.register("tarotGameStarted", self.tarotGameStarted)
59 self.bridge.register("tarotGameNew", self.tarotGameNew)
60 self.bridge.register("tarotGameChooseContrat", self.tarotChooseContrat)
61 self.bridge.register("tarotGameShowCards", self.tarotShowCards)
62 self.bridge.register("tarotGameYourTurn", self.tarotMyTurn)
63 self.bridge.register("tarotGameScore", self.tarotScore)
64 self.bridge.register("tarotGameCardsPlayed", self.tarotCardsPlayed)
65 self.bridge.register("tarotGameInvalidCards", self.tarotInvalidCards)
66 self.bridge.register("quizGameStarted", self.quizGameStarted)
67 self.bridge.register("quizGameNew", self.quizGameNew)
68 self.bridge.register("quizGameQuestion", self.quizGameQuestion)
69 self.bridge.register("quizGamePlayerBuzzed", self.quizGamePlayerBuzzed)
70 self.bridge.register("quizGamePlayerSays", self.quizGamePlayerSays)
71 self.bridge.register("quizGameAnswerResult", self.quizGameAnswerResult)
72 self.bridge.register("quizGameTimerExpired", self.quizGameTimerExpired)
73 self.bridge.register("quizGameTimerRestarted", self.quizGameTimerRestarted)
74 self.bridge.register("subscribe", self.subscribe) 54 self.bridge.register("subscribe", self.subscribe)
75 self.bridge.register("paramUpdate", self.paramUpdate) 55 self.bridge.register("paramUpdate", self.paramUpdate)
76 self.bridge.register("contactDeleted", self.contactDeleted) 56 self.bridge.register("contactDeleted", self.contactDeleted)
77 self.bridge.register("updatedValue", self.updatedValue, "request") 57 self.bridge.register("updatedValue", self.updatedValue)
78 self.bridge.register("askConfirmation", self.askConfirmation, "request") 58 self.bridge.register("askConfirmation", self.askConfirmation)
79 self.bridge.register("actionResult", self.actionResult, "request") 59 self.bridge.register("actionResult", self.actionResult)
80 self.bridge.register("actionResultExt", self.actionResult, "request") 60 self.bridge.register("actionResultExt", self.actionResult)
61 self.bridge.register("roomJoined", self.roomJoined, "plugin")
62 self.bridge.register("roomUserJoined", self.roomUserJoined, "plugin")
63 self.bridge.register("roomUserLeft", self.roomUserLeft, "plugin")
64 self.bridge.register("roomNewSubject", self.roomNewSubject, "plugin")
65 self.bridge.register("tarotGameStarted", self.tarotGameStarted, "plugin")
66 self.bridge.register("tarotGameNew", self.tarotGameNew, "plugin")
67 self.bridge.register("tarotGameChooseContrat", self.tarotChooseContrat, "plugin")
68 self.bridge.register("tarotGameShowCards", self.tarotShowCards, "plugin")
69 self.bridge.register("tarotGameYourTurn", self.tarotMyTurn, "plugin")
70 self.bridge.register("tarotGameScore", self.tarotScore, "plugin")
71 self.bridge.register("tarotGameCardsPlayed", self.tarotCardsPlayed, "plugin")
72 self.bridge.register("tarotGameInvalidCards", self.tarotInvalidCards, "plugin")
73 self.bridge.register("quizGameStarted", self.quizGameStarted, "plugin")
74 self.bridge.register("quizGameNew", self.quizGameNew, "plugin")
75 self.bridge.register("quizGameQuestion", self.quizGameQuestion, "plugin")
76 self.bridge.register("quizGamePlayerBuzzed", self.quizGamePlayerBuzzed, "plugin")
77 self.bridge.register("quizGamePlayerSays", self.quizGamePlayerSays, "plugin")
78 self.bridge.register("quizGameAnswerResult", self.quizGameAnswerResult, "plugin")
79 self.bridge.register("quizGameTimerExpired", self.quizGameTimerExpired, "plugin")
80 self.bridge.register("quizGameTimerRestarted", self.quizGameTimerRestarted, "plugin")
81 81
82 self.current_action_ids = set() 82 self.current_action_ids = set()
83 self.current_action_ids_cb = {} 83 self.current_action_ids_cb = {}
84 self.media_dir = self.bridge.getConfig('','media_dir') 84 self.media_dir = self.bridge.getConfig('','media_dir')
85 85
486 try: 486 try:
487 self.profiles[profile]['onlineContact'].remove(target.short) 487 self.profiles[profile]['onlineContact'].remove(target.short)
488 except KeyError: 488 except KeyError:
489 pass 489 pass
490 490
491 def updatedValue(self, name, data): 491 def updatedValue(self, name, data, profile):
492 if not self.check_profile(profile):
493 return
492 if name == "card_nick": 494 if name == "card_nick":
493 target = JID(data['jid']) 495 target = JID(data['jid'])
494 if target in self.contactList: 496 if target in self.contactList:
495 self.CM.update(target, 'nick', unicode(data['nick'])) 497 self.CM.update(target, 'nick', unicode(data['nick']))
496 self.contactList.replace(target) 498 self.contactList.replace(target)