mod_admin_telnet: Make the muc:create() command complain if the room already exists
authorKim Alvefur <zash@zash.se>
Sun, 26 May 2013 20:58:13 +0000 (22:58 +0200)
committerKim Alvefur <zash@zash.se>
Sun, 26 May 2013 20:58:13 +0000 (22:58 +0200)
plugins/mod_admin_telnet.lua

index 3d149623344be871187824eb836bad493cc0094c..d8dd995121b675f0155dfb3fa9479ebe187b308a 100644 (file)
@@ -922,6 +922,8 @@ end
 
 function def_env.muc:create(room_jid)
        local room, host = check_muc(room_jid);
+       if not room 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