diff options
author | Kim Alvefur <zash@zash.se> | 2016-04-18 19:20:51 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-04-18 19:20:51 +0200 |
commit | 8a98b8c30eea6ccd72330b1985a94a6d382fac43 (patch) | |
tree | 40dddf1e01d93bcc90f08faefb261289fafd0f16 | |
parent | c5447b6de52bbfc7b199d59bc25e09fb4d6bff57 (diff) | |
download | prosody-8a98b8c30eea6ccd72330b1985a94a6d382fac43.tar.gz prosody-8a98b8c30eea6ccd72330b1985a94a6d382fac43.zip |
MUC: Wrap "support" for the groupchat 1.0 join protocol in a config option to allow disabling
-rw-r--r-- | plugins/muc/muc.lib.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 0ea24c08..a7a96865 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -357,6 +357,16 @@ function room_mt:handle_kickable(origin, stanza) -- luacheck: ignore 212 return true; end +if not module:get_option_boolean("muc_compat_create", true) then + module:hook("muc-room-pre-create", function(event) + local origin, stanza = event.origin, event.stanza; + if not stanza:get_child("x", "http://jabber.org/protocol/muc") then + origin.send(st.error_reply(stanza, "cancel", "item-not-found")); + return true; + end + end, -1); +end + -- Give the room creator owner affiliation module:hook("muc-room-pre-create", function(event) event.room:set_affiliation(true, jid_bare(event.stanza.attr.from), "owner"); |