Software / code / prosody
Comparison
plugins/mod_admin_telnet.lua @ 5630:5f3c0b11aa88
mod_admin_telnet: Make the muc:create() command complain if the room already exists
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 26 May 2013 22:58:13 +0200 |
| parent | 5598:3bb8aefd8ce0 |
| child | 5631:78bc91f0d74b |
| child | 5643:e612e1887e39 |
comparison
equal
deleted
inserted
replaced
| 5628:ba5c2f6b799e | 5630:5f3c0b11aa88 |
|---|---|
| 920 return room_name, host; | 920 return room_name, host; |
| 921 end | 921 end |
| 922 | 922 |
| 923 function def_env.muc:create(room_jid) | 923 function def_env.muc:create(room_jid) |
| 924 local room, host = check_muc(room_jid); | 924 local room, host = check_muc(room_jid); |
| 925 if not room then return nil, host end | |
| 926 if hosts[host].modules.muc.rooms[room_jid] then return nil, "Room exists already" end | |
| 925 return hosts[host].modules.muc.create_room(room_jid); | 927 return hosts[host].modules.muc.create_room(room_jid); |
| 926 end | 928 end |
| 927 | 929 |
| 928 function def_env.muc:room(room_jid) | 930 function def_env.muc:room(room_jid) |
| 929 local room_name, host = check_muc(room_jid); | 931 local room_name, host = check_muc(room_jid); |