# HG changeset patch # User Kim Alvefur # Date 1472572464 -7200 # Node ID 5eef792bb2e1db196674d2fd62df90bd8207759a # Parent 279f348e9a92d59d649cc15c5a94b6782f60404b MUC: Restore modern version of public create_room() function removed in dfaacf042cfe diff -r 279f348e9a92 -r 5eef792bb2e1 plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Tue Aug 30 17:53:57 2016 +0200 +++ b/plugins/muc/mod_muc.lua Tue Aug 30 17:54:24 2016 +0200 @@ -173,6 +173,18 @@ 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();