aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2014-05-28 12:43:34 +0100
committerMatthew Wild <mwild1@gmail.com>2014-05-28 12:43:34 +0100
commit496c55391e317de94d5d62cba4088e5f93aae253 (patch)
tree5a08f9daaa6f1c4fdf7bf3e626772c2c17ca7683
parent309f1467649f3e6c1fb8328b10f41cd75475835b (diff)
downloadprosody-496c55391e317de94d5d62cba4088e5f93aae253.tar.gz
prosody-496c55391e317de94d5d62cba4088e5f93aae253.zip
mod_admin_telnet: Add command to list MUC rooms
-rw-r--r--plugins/mod_admin_telnet.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index 9761d2f3..66560d44 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -964,6 +964,19 @@ function def_env.muc:room(room_jid)
return setmetatable({ room = room_obj }, console_room_mt);
end
+function def_env.muc:list(host)
+ local host_session = hosts[host];
+ if not host_session or not host_session.modules.muc then
+ return nil, "Please supply the address of a local MUC component";
+ end
+ local c = 0;
+ for name in keys(host_session.modules.muc.rooms) do
+ print(name);
+ c = c + 1;
+ end
+ return true, c.." rooms";
+end
+
local um = require"core.usermanager";
def_env.user = {};