aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-08-30 17:54:24 +0200
committerKim Alvefur <zash@zash.se>2016-08-30 17:54:24 +0200
commite6fa5c423772e1c379abaeff6f35ba2e1e5153af (patch)
tree19770945bb731a44a424278aff449835d8f4c1fa /plugins
parent98dab3e838adff8cd90a9e6acbc55874871f2cfa (diff)
downloadprosody-e6fa5c423772e1c379abaeff6f35ba2e1e5153af.tar.gz
prosody-e6fa5c423772e1c379abaeff6f35ba2e1e5153af.zip
MUC: Restore modern version of public create_room() function removed in dfaacf042cfe
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/mod_muc.lua12
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();