Changeset

7366:eb3928903009

MUC: Wrap "support" for the groupchat 1.0 join protocol in a config option to allow disabling
author Kim Alvefur <zash@zash.se>
date Mon, 18 Apr 2016 19:20:51 +0200
parents 7365:2d502878b784
children 7367:2aef5e8b69e9
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Mon Apr 18 19:09:10 2016 +0200
+++ b/plugins/muc/muc.lib.lua	Mon Apr 18 19:20:51 2016 +0200
@@ -357,6 +357,16 @@
 	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");