Mercurial > libervia-backend
comparison src/plugins/plugin_exp_command_export.py @ 663:8004c7d4aba7
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.
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 31 Oct 2013 17:18:04 +0100 |
parents | 7ea6d5a86e58 |
children | bfabeedbf32e |
comparison
equal
deleted
inserted
replaced
662:4f747d7fde8c | 663:8004c7d4aba7 |
---|---|
98 if not processes_set: | 98 if not processes_set: |
99 del(self.spawned[(entity, process.profile)]) | 99 del(self.spawned[(entity, process.profile)]) |
100 except ValueError: | 100 except ValueError: |
101 pass | 101 pass |
102 | 102 |
103 def MessageReceivedTrigger(self, message, profile): | 103 def MessageReceivedTrigger(self, message, post_treat, profile): |
104 """ Check if source is linked and repeat message, else do nothing """ | 104 """ Check if source is linked and repeat message, else do nothing """ |
105 from_jid = jid.JID(message["from"]) | 105 from_jid = jid.JID(message["from"]) |
106 spawned_key = (from_jid.userhostJID(), profile) | 106 spawned_key = (from_jid.userhostJID(), profile) |
107 try: | 107 try: |
108 body = [e for e in message.elements() if e.name == 'body'][0] | 108 body = [e for e in message.elements() if e.name == 'body'][0] |