# HG changeset patch # User Kim Alvefur # Date 1520618530 -3600 # Node ID 560419b759c897c79205c4c22ef4c8ee16ffcd1c # Parent 43806beda970593ed2bc124ab457b736faeceae5 MUC: Remove support for GC 1.0 during room creation diff -r 43806beda970 -r 560419b759c8 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Fri Mar 09 18:23:03 2018 +0100 +++ b/plugins/muc/muc.lib.lua Fri Mar 09 19:02:10 2018 +0100 @@ -378,16 +378,6 @@ 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"); @@ -406,6 +396,13 @@ end, -10); function room_mt:handle_first_presence(origin, stanza) + if not stanza:get_child("x", "http://jabber.org/protocol/muc") then + module:log("debug", "Room creation without , possibly desynced"); + + origin.send(st.error_reply(stanza, "cancel", "item-not-found")); + return true; + end + local real_jid = stanza.attr.from; local dest_jid = stanza.attr.to; local bare_jid = jid_bare(real_jid); @@ -417,11 +414,6 @@ local is_first_dest_session = true; local dest_occupant = self:new_occupant(bare_jid, dest_jid); - -- TODO Handle this case sensibly - if not stanza:get_child("x", "http://jabber.org/protocol/muc") then - module:log("debug", "Room creation without , possibly desynced"); - end - local orig_nick = dest_occupant.nick; if module:fire_event("muc-occupant-pre-join", { room = self;