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)
This commit is contained in:
souliane 2013-09-05 20:48:47 +02:00
commit 9cb7071e89

View file

@ -83,6 +83,7 @@ class QuickApp(object):
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 @@ class QuickApp(object):
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):