Comparison

plugins/mod_admin_telnet.lua @ 6067:dab7ad6fa23c

Merge 0.9->0.10
author Kim Alvefur <zash@zash.se>
date Thu, 10 Apr 2014 13:15:11 +0200
parent 6017:ac0879a8190a
parent 6064:c4a3222165c4
child 6169:cb15eac75b50
comparison
equal deleted inserted replaced
6063:e626ee2fe106 6067:dab7ad6fa23c
894 return room_name, host; 894 return room_name, host;
895 end 895 end
896 896
897 function def_env.muc:create(room_jid) 897 function def_env.muc:create(room_jid)
898 local room, host = check_muc(room_jid); 898 local room, host = check_muc(room_jid);
899 if not room_name then
900 return room_name, host;
901 end
899 if not room then return nil, host end 902 if not room then return nil, host end
900 if hosts[host].modules.muc.rooms[room_jid] then return nil, "Room exists already" end 903 if hosts[host].modules.muc.rooms[room_jid] then return nil, "Room exists already" end
901 return hosts[host].modules.muc.create_room(room_jid); 904 return hosts[host].modules.muc.create_room(room_jid);
902 end 905 end
903 906
904 function def_env.muc:room(room_jid) 907 function def_env.muc:room(room_jid)
905 local room_name, host = check_muc(room_jid); 908 local room_name, host = check_muc(room_jid);
909 if not room_name then
910 return room_name, host;
911 end
906 local room_obj = hosts[host].modules.muc.rooms[room_jid]; 912 local room_obj = hosts[host].modules.muc.rooms[room_jid];
907 if not room_obj then 913 if not room_obj then
908 return nil, "No such room: "..room_jid; 914 return nil, "No such room: "..room_jid;
909 end 915 end
910 return setmetatable({ room = room_obj }, console_room_mt); 916 return setmetatable({ room = room_obj }, console_room_mt);