comparison frontends/src/quick_frontend/quick_app.py @ 1352:56c14cb29e0f frontends_multi_profiles

quick_frontend: register the 'personalEvent' signal
author souliane <souliane@mailoo.org>
date Fri, 06 Mar 2015 14:22:49 +0100
parents ec43552f5f8b
children 8ea8fa13c351
comparison
equal deleted inserted replaced
1351:ec43552f5f8b 1352:56c14cb29e0f
267 self.registerSignal("quizGamePlayerSays", iface="plugin") 267 self.registerSignal("quizGamePlayerSays", iface="plugin")
268 self.registerSignal("quizGameAnswerResult", iface="plugin") 268 self.registerSignal("quizGameAnswerResult", iface="plugin")
269 self.registerSignal("quizGameTimerExpired", iface="plugin") 269 self.registerSignal("quizGameTimerExpired", iface="plugin")
270 self.registerSignal("quizGameTimerRestarted", iface="plugin") 270 self.registerSignal("quizGameTimerRestarted", iface="plugin")
271 self.registerSignal("chatStateReceived", iface="plugin") 271 self.registerSignal("chatStateReceived", iface="plugin")
272 self.registerSignal("personalEvent", iface="plugin")
272 273
273 self.current_action_ids = set() # FIXME: to be removed 274 self.current_action_ids = set() # FIXME: to be removed
274 self.current_action_ids_cb = {} # FIXME: to be removed 275 self.current_action_ids_cb = {} # FIXME: to be removed
275 self.media_dir = self.bridge.getConfig('', 'media_dir') 276 self.media_dir = self.bridge.getConfig('', 'media_dir')
276 277
686 from_jid = jid.JID(from_jid_s) if from_jid_s != C.ENTITY_ALL else C.ENTITY_ALL 687 from_jid = jid.JID(from_jid_s) if from_jid_s != C.ENTITY_ALL else C.ENTITY_ALL
687 for widget in self.widgets.getWidgets(quick_chat.QuickChat): 688 for widget in self.widgets.getWidgets(quick_chat.QuickChat):
688 if from_jid == C.ENTITY_ALL or from_jid.bare == widget.target.bare: 689 if from_jid == C.ENTITY_ALL or from_jid.bare == widget.target.bare:
689 widget.updateChatState(from_jid, state) 690 widget.updateChatState(from_jid, state)
690 691
692 def personalEventHandler(self, sender, event_type, data):
693 """Called when a PEP event is received.
694
695 @param sender (jid.JID): event sender
696 @param event_type (unicode): event type, e.g. 'MICROBLOG' or 'MICROBLOG_DELETE'
697 @param data (dict): event data
698 """
699 # FIXME move some code from Libervia to here and put the magic strings to constants
700 pass
701
691 def _subscribe_cb(self, answer, data): 702 def _subscribe_cb(self, answer, data):
692 entity, profile = data 703 entity, profile = data
693 type_ = "subscribed" if answer else "unsubscribed" 704 type_ = "subscribed" if answer else "unsubscribed"
694 self.bridge.subscription(type_, unicode(entity.bare), profile_key=profile) 705 self.bridge.subscription(type_, unicode(entity.bare), profile_key=profile)
695 706