comparison plugins/mod_pubsub/mod_pubsub.lua @ 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 8091c1b8023e
children 5033029130f5
comparison
equal deleted inserted replaced
13600:854df134274f 13601:0338a5569178
183 local ok, ret = service:get_nodes(stanza.attr.from); 183 local ok, ret = service:get_nodes(stanza.attr.from);
184 if not ok then 184 if not ok then
185 return; 185 return;
186 end 186 end
187 for node, node_obj in pairs(ret) do 187 for node, node_obj in pairs(ret) do
188 reply:tag("item", { jid = module.host, node = node, name = node_obj.config.title }):up(); 188 local ok, meta = service:get_node_metadata(node, stanza.attr.from);
189 if ok then
190 reply:tag("item", { jid = module.host, node = node, name = meta.title }):up();
191 end
189 end 192 end
190 end); 193 end);
191 194
192 local admin_aff = module:get_option_enum("default_admin_affiliation", "owner", "publisher", "member", "outcast", "none"); 195 local admin_aff = module:get_option_enum("default_admin_affiliation", "owner", "publisher", "member", "outcast", "none");
193 196