MUC: Restore modern version of public create_room() function removed in dfaacf042cfe
--- 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();