Diff

mod_sasl2_bind2/mod_sasl2_bind2.lua @ 5060:bc491065c221

mod_sasl2_bind2, mod_sasl2_sm: Remove bind2 <features/> wrapper element This was dropped from the spec. It's more consistent with SASL2.
author Matthew Wild <mwild1@gmail.com>
date Tue, 27 Sep 2022 18:23:42 +0100
parent 5047:023f21bfcc08
child 5093:f2dfbcc676a6
line wrap: on
line diff
--- 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