mod_sasl2_bind2, mod_sasl2_sm: Remove bind2 <features/> wrapper element
authorMatthew Wild <mwild1@gmail.com>
Tue, 27 Sep 2022 18:23:42 +0100
changeset 5064 bc491065c221
parent 5063 5f1120c284c5
child 5065 e44b868cc575
mod_sasl2_bind2, mod_sasl2_sm: Remove bind2 <features/> wrapper element This was dropped from the spec. It's more consistent with SASL2.
mod_sasl2_bind2/mod_sasl2_bind2.lua
mod_sasl2_sm/mod_sasl2_sm.lua
--- a/mod_sasl2_bind2/mod_sasl2_bind2.lua	Sat Sep 24 09:26:26 2022 +0100
+++ b/mod_sasl2_bind2/mod_sasl2_bind2.lua	Tue Sep 27 18:23:42 2022 +0100
@@ -44,11 +44,9 @@
 -- Enable inline features requested by the client
 
 local function enable_features(session, bind_request, bind_result)
-	local features = bind_request:get_child("features");
-	if not features then return; end
 	module:fire_event("enable-bind-features", {
 		session = session;
-		features = features;
+		request = bind_request;
 		result = bind_result;
 	});
 end
@@ -92,16 +90,16 @@
 end);
 
 module:hook("enable-bind-features", function (event)
-	local session, features = event.session, event.features;
+	local session, request = event.session, event.request;
 
 	-- Carbons
-	if features:get_child("enable", "urn:xmpp:carbons:2") then
+	if request:get_child("enable", "urn:xmpp:carbons:2") then
 		session.want_carbons = true;
 		event.result:tag("enabled", { xmlns = "urn:xmpp:carbons:2" }):up();
 	end
 
 	-- CSI
-	local csi_state_tag = features:child_with_ns("urn:xmpp:csi:0");
+	local csi_state_tag = request:child_with_ns("urn:xmpp:csi:0");
 	if csi_state_tag then
 		session.state = csi_state_tag.name;
 	end
--- a/mod_sasl2_sm/mod_sasl2_sm.lua	Sat Sep 24 09:26:26 2022 +0100
+++ b/mod_sasl2_sm/mod_sasl2_sm.lua	Tue Sep 27 18:23:42 2022 +0100
@@ -57,7 +57,7 @@
 end);
 
 module:hook("enable-bind-features", function (event)
-	local sm_enable = event.features:get_child("enable", xmlns_sm);
+	local sm_enable = event.request:get_child("enable", xmlns_sm);
 	if not sm_enable then return; end
 
 	local sm_result;