diff 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
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_app.py	Sun Sep 08 19:12:59 2013 +0200
+++ b/frontends/src/quick_frontend/quick_app.py	Thu Sep 05 20:48:47 2013 +0200
@@ -83,6 +83,7 @@
         self.bridge.register("quizGameAnswerResult", self.quizGameAnswerResult, "plugin")
         self.bridge.register("quizGameTimerExpired", self.quizGameTimerExpired, "plugin")
         self.bridge.register("quizGameTimerRestarted", self.quizGameTimerRestarted, "plugin")
+        self.bridge.register("chatStateReceived", self.chatStateReceived, "plugin")
 
         self.current_action_ids = set()
         self.current_action_ids_cb = {}
@@ -281,11 +282,11 @@
         timestamp = extra.get('archive')
         self.chat_wins[win.short].printMessage(from_jid, msg, profile, float(timestamp) if timestamp else '')
 
-    def sendMessage(self, to_jid, message, subject='', mess_type="auto", profile_key="@DEFAULT@"):
+    def sendMessage(self, to_jid, message, subject='', mess_type="auto", options={}, profile_key="@NONE@"):
         if to_jid.startswith(const_PRIVATE_PREFIX):
             to_jid = unescapePrivate(to_jid)
             mess_type = "chat"
-        self.bridge.sendMessage(to_jid, message, subject, mess_type, profile_key)
+        self.bridge.sendMessage(to_jid, message, subject, mess_type, options, profile_key)
 
     def newAlert(self, msg, title, alert_type, profile):
         if not self.check_profile(profile):