comparison frontends/src/quick_frontend/quick_app.py @ 636:7ea6d5a86e58

plugin XEP-0085: Chat State Notifications - new "options" parameter to send chat states - plugin command export: messages without body are now delivered (since all the chat states other than "active" need them)
author souliane <souliane@mailoo.org>
date Thu, 05 Sep 2013 20:48:47 +0200
parents d207c2186519
children 262d9d9ad27a
comparison
equal deleted inserted replaced
635:eff8772fd472 636:7ea6d5a86e58
81 self.bridge.register("quizGamePlayerBuzzed", self.quizGamePlayerBuzzed, "plugin") 81 self.bridge.register("quizGamePlayerBuzzed", self.quizGamePlayerBuzzed, "plugin")
82 self.bridge.register("quizGamePlayerSays", self.quizGamePlayerSays, "plugin") 82 self.bridge.register("quizGamePlayerSays", self.quizGamePlayerSays, "plugin")
83 self.bridge.register("quizGameAnswerResult", self.quizGameAnswerResult, "plugin") 83 self.bridge.register("quizGameAnswerResult", self.quizGameAnswerResult, "plugin")
84 self.bridge.register("quizGameTimerExpired", self.quizGameTimerExpired, "plugin") 84 self.bridge.register("quizGameTimerExpired", self.quizGameTimerExpired, "plugin")
85 self.bridge.register("quizGameTimerRestarted", self.quizGameTimerRestarted, "plugin") 85 self.bridge.register("quizGameTimerRestarted", self.quizGameTimerRestarted, "plugin")
86 self.bridge.register("chatStateReceived", self.chatStateReceived, "plugin")
86 87
87 self.current_action_ids = set() 88 self.current_action_ids = set()
88 self.current_action_ids_cb = {} 89 self.current_action_ids_cb = {}
89 self.media_dir = self.bridge.getConfig('','media_dir') 90 self.media_dir = self.bridge.getConfig('','media_dir')
90 91
279 self.current_action_ids_cb = {} 280 self.current_action_ids_cb = {}
280 281
281 timestamp = extra.get('archive') 282 timestamp = extra.get('archive')
282 self.chat_wins[win.short].printMessage(from_jid, msg, profile, float(timestamp) if timestamp else '') 283 self.chat_wins[win.short].printMessage(from_jid, msg, profile, float(timestamp) if timestamp else '')
283 284
284 def sendMessage(self, to_jid, message, subject='', mess_type="auto", profile_key="@DEFAULT@"): 285 def sendMessage(self, to_jid, message, subject='', mess_type="auto", options={}, profile_key="@NONE@"):
285 if to_jid.startswith(const_PRIVATE_PREFIX): 286 if to_jid.startswith(const_PRIVATE_PREFIX):
286 to_jid = unescapePrivate(to_jid) 287 to_jid = unescapePrivate(to_jid)
287 mess_type = "chat" 288 mess_type = "chat"
288 self.bridge.sendMessage(to_jid, message, subject, mess_type, profile_key) 289 self.bridge.sendMessage(to_jid, message, subject, mess_type, options, profile_key)
289 290
290 def newAlert(self, msg, title, alert_type, profile): 291 def newAlert(self, msg, title, alert_type, profile):
291 if not self.check_profile(profile): 292 if not self.check_profile(profile):
292 return 293 return
293 assert alert_type in ['INFO','ERROR'] 294 assert alert_type in ['INFO','ERROR']