aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub/mod_pubsub.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_pubsub/mod_pubsub.lua')
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua19
1 files changed, 2 insertions, 17 deletions
diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua
index 9e9656c1..c97e9d98 100644
--- a/plugins/mod_pubsub/mod_pubsub.lua
+++ b/plugins/mod_pubsub/mod_pubsub.lua
@@ -88,26 +88,11 @@ local function add_disco_features_from_service(service) --luacheck: ignore 431/s
end
module:hook("host-disco-info-node", function (event)
- local stanza, reply, node = event.stanza, event.reply, event.node;
- local ok, ret = service:get_nodes(stanza.attr.from);
- if not ok or not ret[node] then
- return;
- end
- event.exists = true;
- reply:tag("identity", { category = "pubsub", type = "leaf" });
+ return lib_pubsub.handle_disco_info_node(event, service);
end);
module:hook("host-disco-items-node", function (event)
- local stanza, reply, node = event.stanza, event.reply, event.node;
- local ok, ret = service:get_items(node, stanza.attr.from);
- if not ok then
- return;
- end
-
- for _, id in ipairs(ret) do
- reply:tag("item", { jid = module.host, name = id }):up();
- end
- event.exists = true;
+ return lib_pubsub.handle_disco_items_node(event, service);
end);