From 99b85eda3242876ec57364c97141e30c50d8abb2 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 19 Aug 2018 23:37:19 +0100 Subject: util.pubsub: Fire item-published/ to allow for easier handling of per-node items --- util/pubsub.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3