Mercurial > prosody-hg
comparison plugins/muc/mod_muc.lua @ 7641:5eef792bb2e1
MUC: Restore modern version of public create_room() function removed in dfaacf042cfe
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 30 Aug 2016 17:54:24 +0200 |
| parents | 3f8520b59677 |
| children | 4c2407422f71 |
comparison
equal
deleted
inserted
replaced
| 7640:279f348e9a92 | 7641:5eef792bb2e1 |
|---|---|
| 169 if room then | 169 if room then |
| 170 rooms:set(room_jid, room); -- bump to top; | 170 rooms:set(room_jid, room); -- bump to top; |
| 171 return room; | 171 return room; |
| 172 end | 172 end |
| 173 return restore_room(room_jid); | 173 return restore_room(room_jid); |
| 174 end | |
| 175 | |
| 176 function create_room(room_jid) | |
| 177 local exists = get_room_from_jid(room_jid); | |
| 178 if exists then | |
| 179 return nil, "room-exists"; | |
| 180 end | |
| 181 local room = muclib.new_room(room_jid); | |
| 182 module:fire_event("muc-room-created", { | |
| 183 room = room; | |
| 184 }); | |
| 185 return room; | |
| 174 end | 186 end |
| 175 | 187 |
| 176 function each_room(local_only) | 188 function each_room(local_only) |
| 177 if local_only then | 189 if local_only then |
| 178 return rooms:values(); | 190 return rooms:values(); |
