Software /
code /
prosody-modules
Diff
mod_sasl2_bind2/mod_sasl2_bind2.lua @ 5043:17b87fffdb91
mod_sasl2_bind2: Move <inline> into <bind> feature element
This mirrors the equivalent change in SASL2.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 21 Sep 2022 10:31:50 +0100 |
parent | 5039:c0d243b27e64 |
child | 5044:f64d834ba744 |
line wrap: on
line diff
--- a/mod_sasl2_bind2/mod_sasl2_bind2.lua Wed Sep 21 10:25:34 2022 +0100 +++ b/mod_sasl2_bind2/mod_sasl2_bind2.lua Wed Sep 21 10:31:50 2022 +0100 @@ -9,20 +9,13 @@ -- Advertise what we can do -module:hook("stream-features", function(event) - local origin, features = event.origin, event.features; - - if origin.type ~= "c2s_unauthed" then - return; - end +module:hook("advertise-sasl-features", function(event) + local bind = st.stanza("bind", { xmlns = xmlns_bind2 }); + local inline = st.stanza("inline"); + module:fire_event("advertise-bind-features", { origin = event.session, features = inline }); + bind:add_direct_child(inline); - local inline = st.stanza("inline", { xmlns = xmlns_bind2 }); - module:fire_event("advertise-bind-features", { origin = origin, features = inline }); - features:add_direct_child(inline); -end, 1); - -module:hook("advertise-sasl-features", function(event) - event.features:tag("bind", { xmlns = xmlns_bind2 }):up(); + event.features:add_direct_child(bind); end, 1); -- Helper to actually bind a resource to a session