aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-03-09 19:02:10 +0100
committerKim Alvefur <zash@zash.se>2018-03-09 19:02:10 +0100
commit51938f487aff8ffb7f211d925ec8ba05d810dfc5 (patch)
treed08f7f5df5e7bbb5096fb35a48564fefd7c8f8a7
parent93df1fa04fae01c2462365695257ac9a8dac7985 (diff)
downloadprosody-51938f487aff8ffb7f211d925ec8ba05d810dfc5.tar.gz
prosody-51938f487aff8ffb7f211d925ec8ba05d810dfc5.zip
MUC: Remove support for GC 1.0 during room creation
-rw-r--r--plugins/muc/muc.lib.lua22
1 files changed, 7 insertions, 15 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 40fdc5a0..9ae54d5e 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -378,16 +378,6 @@ 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");
@@ -406,6 +396,13 @@ module:hook("muc-occupant-pre-join", function(event)
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 <x>, 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 @@ function room_mt:handle_first_presence(origin, stanza)
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 <x>, possibly desynced");
- end
-
local orig_nick = dest_occupant.nick;
if module:fire_event("muc-occupant-pre-join", {
room = self;