From 0907621d2f7e4114cc7c54714e9c72adb27e5ee7 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 18 Apr 2016 19:20:51 +0200 Subject: MUC: Wrap "support" for the groupchat 1.0 join protocol in a config option to allow disabling --- plugins/muc/muc.lib.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'plugins/muc') 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"); -- cgit v1.2.3