diff options
author | Matthew Wild <mwild1@gmail.com> | 2013-04-25 20:37:51 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2013-04-25 20:37:51 +0100 |
commit | 2716bbf64ff4f9c62bb578802de9e16b42d5203d (patch) | |
tree | 0f587a95354aa54cd7e6365fde97fb1050c6c7da /plugins/mod_admin_telnet.lua | |
parent | c953a057a8fb1e0b0617dd090ab4ff7a643956c3 (diff) | |
parent | 55b90a8abd0e65e476c7df3fe0ff437a99607f3e (diff) | |
download | prosody-2716bbf64ff4f9c62bb578802de9e16b42d5203d.tar.gz prosody-2716bbf64ff4f9c62bb578802de9e16b42d5203d.zip |
Merge 0.9->trunk
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index e1b90684..2622a5f9 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -903,13 +903,23 @@ local console_room_mt = { end; }; -function def_env.muc:room(room_jid) - local room_name, host = jid_split(room_jid); +local function check_muc(jid) + local room_name, host = jid_split(jid); if not hosts[host] then return nil, "No such host: "..host; elseif not hosts[host].modules.muc then return nil, "Host '"..host.."' is not a MUC service"; end + return room_name, host; +end + +function def_env.muc:create(room_jid) + local room, host = check_muc(room_jid); + return hosts[host].modules.muc.create_room(room_jid); +end + +function def_env.muc:room(room_jid) + local room_name, host = check_muc(room_jid); local room_obj = hosts[host].modules.muc.rooms[room_jid]; if not room_obj then return nil, "No such room: "..room_jid; |