diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-08-19 23:37:19 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-08-19 23:37:19 +0100 |
commit | a1cc1b40650dc2aa45583454067bd0b87d718b6f (patch) | |
tree | a1815e151212a8fc5cfd2e33480015b30a7044dc /util | |
parent | 028db90d4ba000f91d61a9b507105aea1379136d (diff) | |
download | prosody-a1cc1b40650dc2aa45583454067bd0b87d718b6f.tar.gz prosody-a1cc1b40650dc2aa45583454067bd0b87d718b6f.zip |
util.pubsub: Fire item-published/<node> to allow for easier handling of per-node items
Diffstat (limited to 'util')
-rw-r--r-- | util/pubsub.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua index c449625a..4f5b51ec 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -517,7 +517,9 @@ function service:publish(node, actor, id, item, required_config) return nil, "internal-server-error"; end if type(ok) == "string" then id = ok; end - self.events.fire_event("item-published", { node = node, actor = actor, id = id, item = item }); + local event_data = { node = node, actor = actor, id = id, item = item }; + self.events.fire_event("item-published/"..node, event_data); + self.events.fire_event("item-published", event_data); self.config.broadcaster("items", node, node_obj.subscribers, item, actor, node_obj, self); return true; end |