Changeset

12726:9f100ab9ffdf

mod_saslauth: Put <sasl-channel-binding> in stream:features per XEP-0440 0.4.0
author Matthew Wild <mwild1@gmail.com>
date Wed, 21 Sep 2022 15:00:06 +0100
parents 12725:12ced5db29b2
children 12727:31d719ce8c64
files plugins/mod_saslauth.lua
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua	Thu Sep 15 11:11:52 2022 +0200
+++ b/plugins/mod_saslauth.lua	Wed Sep 21 15:00:06 2022 +0100
@@ -321,15 +321,15 @@
 			for mechanism in usable_mechanisms do
 				mechanisms:tag("mechanism"):text(mechanism):up();
 			end
+			features:add_child(mechanisms);
 			if not channel_bindings:empty() then
 				-- XXX XEP-0440 is Experimental
-				mechanisms:tag("sasl-channel-binding", {xmlns='urn:xmpp:sasl-cb:0'})
+				features:tag("sasl-channel-binding", {xmlns='urn:xmpp:sasl-cb:0'})
 				for channel_binding in channel_bindings do
-					mechanisms:tag("channel-binding", {type=channel_binding}):up()
+					features:tag("channel-binding", {type=channel_binding}):up()
 				end
-				mechanisms:up();
+				features:up();
 			end
-			features:add_child(mechanisms);
 			return;
 		end