Changeset

13601:0338a5569178

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.
author Kim Alvefur <zash@zash.se>
date Tue, 07 Jan 2025 22:57:39 +0100
parents 13600:854df134274f
children 13602:5033029130f5
files plugins/mod_pubsub/mod_pubsub.lua
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pubsub/mod_pubsub.lua	Tue Jan 07 19:28:06 2025 +0000
+++ b/plugins/mod_pubsub/mod_pubsub.lua	Tue Jan 07 22:57:39 2025 +0100
@@ -185,7 +185,10 @@
 		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);