diff options
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-rw-r--r-- | plugins/muc/mod_muc.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index 0f327c13..41b84a86 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -173,6 +173,18 @@ function get_room_from_jid(room_jid) return restore_room(room_jid); end +function create_room(room_jid) + local exists = get_room_from_jid(room_jid); + if exists then + return nil, "room-exists"; + end + local room = muclib.new_room(room_jid); + module:fire_event("muc-room-created", { + room = room; + }); + return room; +end + function each_room(local_only) if local_only then return rooms:values(); |