diff mod_sasl2_bind2/mod_sasl2_bind2.lua @ 5036:9ef5625d0d39

mod_sasl2_bind2: Indicate to the client when carbons has been enabled
author Matthew Wild <mwild1@gmail.com>
date Sat, 03 Sep 2022 18:20:07 +0100
parents 9afd98178011
children 8a8100fff580
line wrap: on
line diff
--- a/mod_sasl2_bind2/mod_sasl2_bind2.lua	Sat Sep 03 18:11:25 2022 +0100
+++ b/mod_sasl2_bind2/mod_sasl2_bind2.lua	Sat Sep 03 18:20:07 2022 +0100
@@ -102,7 +102,10 @@
 	local session, features = event.session, event.features;
 
 	-- Carbons
-	session.want_carbons = not not features:get_child("enable", "urn:xmpp:carbons:2");
+	if features: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");