Merge 0.10->trunk
[prosody.git] / plugins / mod_admin_telnet.lua
index 5388a0e606f316bc55b6434b740bcbf498e88daf..55eb2e553a1b766e896a29d466cfb80bf201d3f2 100644 (file)
@@ -170,6 +170,10 @@ function console_listener.ondisconnect(conn, err)
        end
 end
 
+function console_listener.ondetach(conn)
+       sessions[conn] = nil;
+end
+
 -- Console commands --
 -- These are simple commands, not valid standalone in Lua
 
@@ -957,7 +961,7 @@ function def_env.muc:room(room_jid)
        if not room_name then
                return room_name, host;
        end
-       local room_obj = hosts[host].modules.muc.rooms[room_jid];
+       local room_obj = hosts[host].modules.muc.get_room_from_jid(room_jid);
        if not room_obj then
                return nil, "No such room: "..room_jid;
        end
@@ -970,8 +974,8 @@ function def_env.muc:list(host)
                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);
+       for room in host_session.modules.muc.each_room() do
+               print(room.jid);
                c = c + 1;
        end
        return true, c.." rooms";