# HG changeset patch # User Matthew Wild # Date 1401277414 -3600 # Node ID 6986ca5755680d2f9b64d1d79f482938cd7b93c8 # Parent 36f61162498725cb3d93a94f86cf35249c287bcc mod_admin_telnet: Add command to list MUC rooms diff -r 36f611624987 -r 6986ca575568 plugins/mod_admin_telnet.lua --- a/plugins/mod_admin_telnet.lua Sat May 24 11:17:26 2014 +0200 +++ b/plugins/mod_admin_telnet.lua Wed May 28 12:43:34 2014 +0100 @@ -964,6 +964,19 @@ 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 = {};