aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-08-19 23:37:19 +0100
committerMatthew Wild <mwild1@gmail.com>2018-08-19 23:37:19 +0100
commit99b85eda3242876ec57364c97141e30c50d8abb2 (patch)
treea1815e151212a8fc5cfd2e33480015b30a7044dc /util
parent3b0271f56013234cf4d967808627cd350f624f38 (diff)
downloadprosody-99b85eda3242876ec57364c97141e30c50d8abb2.tar.gz
prosody-99b85eda3242876ec57364c97141e30c50d8abb2.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.lua4
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