From c900aab69e8f61610e5dce1785e6df46de2a92c4 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 7 Jan 2025 22:57:39 +0100 Subject: mod_pubsub: Limit node listing based on new ACL-aware metadata method Ensures that nodes that one does not have metadata access to are hidden from view. This follows from the new ACL-aware method added in 3b357ab6b6eb. --- plugins/mod_pubsub/mod_pubsub.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins/mod_pubsub/mod_pubsub.lua') diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua index 54382712..413047e0 100644 --- a/plugins/mod_pubsub/mod_pubsub.lua +++ b/plugins/mod_pubsub/mod_pubsub.lua @@ -185,7 +185,10 @@ module:hook("host-disco-items", function (event) return; end for node, node_obj in pairs(ret) do - reply:tag("item", { jid = module.host, node = node, name = node_obj.config.title }):up(); + local ok, meta = service:get_node_metadata(node, stanza.attr.from); + if ok then + reply:tag("item", { jid = module.host, node = node, name = meta.title }):up(); + end end end); -- cgit v1.2.3