comparison 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
comparison
equal deleted inserted replaced
5035:baebe7452903 5036:9ef5625d0d39
100 100
101 module:hook("enable-bind-features", function (event) 101 module:hook("enable-bind-features", function (event)
102 local session, features = event.session, event.features; 102 local session, features = event.session, event.features;
103 103
104 -- Carbons 104 -- Carbons
105 session.want_carbons = not not features:get_child("enable", "urn:xmpp:carbons:2"); 105 if features:get_child("enable", "urn:xmpp:carbons:2") then
106 session.want_carbons = true;
107 event.result:tag("enabled", { xmlns = "urn:xmpp:carbons:2" }):up();
108 end
106 109
107 -- CSI 110 -- CSI
108 local csi_state_tag = features:child_with_ns("urn:xmpp:csi:0"); 111 local csi_state_tag = features:child_with_ns("urn:xmpp:csi:0");
109 if csi_state_tag then 112 if csi_state_tag then
110 session.state = csi_state_tag.name; 113 session.state = csi_state_tag.name;