core: Deferred in onMessage.
onMessage now use a deferred which is passed to MessageReceived trigger through the post_treat parameter. This can be used by plugins to add deferred in the callback chain.
This commit is contained in:
parent
bd7f2d6e84
commit
59b4505dfd
4 changed files with 32 additions and 21 deletions
|
|
@ -100,7 +100,7 @@ class CommandExport(object):
|
|||
except ValueError:
|
||||
pass
|
||||
|
||||
def MessageReceivedTrigger(self, message, profile):
|
||||
def MessageReceivedTrigger(self, message, post_treat, profile):
|
||||
""" Check if source is linked and repeat message, else do nothing """
|
||||
from_jid = jid.JID(message["from"])
|
||||
spawned_key = (from_jid.userhostJID(), profile)
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class Exp_Parrot(object):
|
|||
# debug("Parrot link detected, skipping other triggers")
|
||||
# raise SkipOtherTriggers
|
||||
|
||||
def MessageReceivedTrigger(self, message, profile):
|
||||
def MessageReceivedTrigger(self, message, post_treat, profile):
|
||||
""" Check if source is linked and repeat message, else do nothing """
|
||||
client = self.host.getClient(profile)
|
||||
from_jid = jid.JID(message["from"])
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class MaildirBox(object):
|
|||
del self.__mailboxes[profile]
|
||||
del self.data[profile]
|
||||
|
||||
def messageReceivedTrigger(self, message, profile):
|
||||
def messageReceivedTrigger(self, message, post_treat, profile):
|
||||
"""This trigger catch normal message and put the in the Maildir box.
|
||||
If the message is not of "normal" type, do nothing
|
||||
@param message: message xmlstrem
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ class XEP_0085(object):
|
|||
if (category, name) == (PARAM_KEY, PARAM_NAME):
|
||||
self.updateEntityData("@ALL@", True if value == "true" else "@NONE@", profile)
|
||||
|
||||
def messageReceivedTrigger(self, message, profile):
|
||||
def messageReceivedTrigger(self, message, post_treat, profile):
|
||||
"""
|
||||
Update the entity cache when we receive a message with body.
|
||||
Check for a check state in the incoming message and broadcast signal.
|
||||
|
|
|
|||
Loading…
Reference in a new issue