aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2023-11-07 11:10:38 +0000
committerMatthew Wild <mwild1@gmail.com>2023-11-07 11:10:38 +0000
commit8b0521f24437978d951ed6aa22e639dec9805b22 (patch)
tree0413c1c50095c65f56d51bd46df7ded5134ce464
parentdeaa31ddc00bc67007ad21f064df52f2c678e755 (diff)
downloadprosody-8b0521f24437978d951ed6aa22e639dec9805b22.tar.gz
prosody-8b0521f24437978d951ed6aa22e639dec9805b22.zip
mod_muc: Add :list-rooms permission
-rw-r--r--plugins/muc/mod_muc.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 84cdd901..0be5348a 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -350,8 +350,12 @@ function each_room(live_only)
end
module:hook("host-disco-items", function(event)
- local reply = event.reply;
module:log("debug", "host-disco-items called");
+ if not module:could(":list-rooms", event) then
+ module:log("debug", "Returning empty room list to unauthorized request");
+ return;
+ end
+ local reply = event.reply;
if next(room_items_cache) ~= nil then
for jid, room_name in pairs(room_items_cache) do
if room_name == "" then room_name = nil; end