Changeset

4794:d17a1581ea30

mod_bind2: Advertise stream feature
author Kim Alvefur <zash@zash.se>
date Sun, 28 Nov 2021 19:59:26 +0100
parents 4793:aaa6f412dce3
children 4795:8849b4f68534
files mod_bind2/mod_bind2.lua
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_bind2/mod_bind2.lua	Sun Nov 28 19:45:25 2021 +0100
+++ b/mod_bind2/mod_bind2.lua	Sun Nov 28 19:59:26 2021 +0100
@@ -7,6 +7,12 @@
 module:depends("sasl2");
 module:depends("carbons");
 
+module:hook("stream-features", function(event)
+	local origin, features = event.origin, event.features;
+	if origin.type ~= "c2s_unauthed" then return end
+	features:tag("bind", xmlns_bind2):up();
+end);
+
 module:hook_tag(xmlns_sasl2, "authenticate", function (session, auth)
 	session.bind2 = auth:get_child("bind", xmlns_bind2);
 end, 1);