aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
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
commitf25bb95b8680adffa070c07fa762bde6af383957 (patch)
tree19770945bb731a44a424278aff449835d8f4c1fa /plugins/muc
parent5235e5ec1a3ee5eb6215e5b28e04069197571b7c (diff)
downloadprosody-f25bb95b8680adffa070c07fa762bde6af383957.tar.gz
prosody-f25bb95b8680adffa070c07fa762bde6af383957.zip
MUC: Restore modern version of public create_room() function removed in dfaacf042cfe
Diffstat (limited to 'plugins/muc')
-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();