From a0562991c4e2f94987b1c451099dacc38b1b620d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 26 Jun 2018 19:34:35 +0200 Subject: mod_pubsub: Retrieve the node object --- plugins/mod_pubsub/pubsub.lib.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins/mod_pubsub/pubsub.lib.lua') diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua index b030abbd..a43161c4 100644 --- a/plugins/mod_pubsub/pubsub.lib.lua +++ b/plugins/mod_pubsub/pubsub.lib.lua @@ -465,6 +465,12 @@ function handlers.owner_get_affiliations(origin, stanza, affiliations, service) return true; end + local node_obj = service.nodes[node]; + if not node_obj then + origin.send(pubsub_error_reply(stanza, "item-not-found")); + return true; + end + local reply = st.reply(stanza) :tag("pubsub", { xmlns = xmlns_pubsub_owner }) :tag("affiliations", { node = node }); -- cgit v1.2.3