aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-10-20 14:22:36 +0200
committerKim Alvefur <zash@zash.se>2022-10-20 14:22:36 +0200
commit96fb9a4a32a8da4610e363a832bc9a22dba1b44e (patch)
tree1d35e045e6914f9d996d7f6a015a3d3baa885ef7
parent728ee0b92a03549fc6598ddde5f46796eb859e0f (diff)
downloadprosody-96fb9a4a32a8da4610e363a832bc9a22dba1b44e.tar.gz
prosody-96fb9a4a32a8da4610e363a832bc9a22dba1b44e.zip
mod_s2s: Advertise stream features on bidi connections
-rw-r--r--plugins/mod_s2s.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/mod_s2s.lua b/plugins/mod_s2s.lua
index 24a301f1..e4469c20 100644
--- a/plugins/mod_s2s.lua
+++ b/plugins/mod_s2s.lua
@@ -247,6 +247,12 @@ function module.add_host(module)
end
module:hook("route/remote", route_to_existing_session, -1);
module:hook("route/remote", route_to_new_session, -10);
+ module:hook("s2sout-stream-features", function (event)
+ if stanza_size_limit then
+ event.features:tag("limits", { xmlns = "urn:xmpp:stream-limits:0" })
+ :text_tag("max-size", string.format("%d", stanza_size_limit)):up();
+ end
+ end);
module:hook("s2s-authenticated", make_authenticated, -1);
module:hook("s2s-read-timeout", keepalive, -1);
module:hook_stanza("http://etherx.jabber.org/streams", "features", function (session, stanza) -- luacheck: ignore 212/stanza