aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub/mod_pubsub.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2025-01-07 22:57:39 +0100
committerKim Alvefur <zash@zash.se>2025-01-07 22:57:39 +0100
commitc900aab69e8f61610e5dce1785e6df46de2a92c4 (patch)
tree07729d519c6f7b0a0a0b4b7e888339006f2fb6ea /plugins/mod_pubsub/mod_pubsub.lua
parentfbb3a116dbda8825be39810d29b0559bef44bab9 (diff)
downloadprosody-c900aab69e8f61610e5dce1785e6df46de2a92c4.tar.gz
prosody-c900aab69e8f61610e5dce1785e6df46de2a92c4.zip
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.
Diffstat (limited to 'plugins/mod_pubsub/mod_pubsub.lua')
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua5
1 files changed, 4 insertions, 1 deletions
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);