mod_admin_telnet: rename variable to make it defined (room -> room_name)
[prosody.git] / plugins / mod_admin_telnet.lua
index 73698adae58745783d1f22f808cede071c50281e..b2a013247c7026fa60dbdf6b46e215df9aa6fd97 100644 (file)
@@ -557,11 +557,11 @@ local function show_c2s(callback)
        c2s:sort(function(a, b)
                if a.host == b.host then
                        if a.username == b.username then
-                               return a.resource or "" > b.resource or "";
+                               return (a.resource or "") > (b.resource or "");
                        end
-                       return a.username or "" > b.username or "";
+                       return (a.username or "") > (b.username or "");
                end
-               return a.host or "" > b.host or "";
+               return (a.host or "") > (b.host or "");
        end):map(function (session)
                callback(get_jid(session), session)
        end);
@@ -957,11 +957,11 @@ local function check_muc(jid)
 end
 
 function def_env.muc:create(room_jid)
-       local room, host = check_muc(room_jid);
+       local room_name, host = check_muc(room_jid);
        if not room_name then
                return room_name, host;
        end
-       if not room then return nil, host end
+       if not room_name then return nil, host end
        if hosts[host].modules.muc.rooms[room_jid] then return nil, "Room exists already" end
        return hosts[host].modules.muc.create_room(room_jid);
 end