Software /
code /
prosody
Comparison
plugins/mod_s2s.lua @ 12810:871d2c95b403
mod_s2s: Advertise stream features on bidi connections
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 20 Oct 2022 14:22:36 +0200 |
parent | 12808:12bd40b8e105 |
child | 12811:ccc0bdad82cc |
comparison
equal
deleted
inserted
replaced
12809:71bd009a9789 | 12810:871d2c95b403 |
---|---|
245 module:log("warn", "The 'disallow_s2s' config option is deprecated, please see https://prosody.im/doc/s2s#disabling"); | 245 module:log("warn", "The 'disallow_s2s' config option is deprecated, please see https://prosody.im/doc/s2s#disabling"); |
246 return nil, "This host has disallow_s2s set"; | 246 return nil, "This host has disallow_s2s set"; |
247 end | 247 end |
248 module:hook("route/remote", route_to_existing_session, -1); | 248 module:hook("route/remote", route_to_existing_session, -1); |
249 module:hook("route/remote", route_to_new_session, -10); | 249 module:hook("route/remote", route_to_new_session, -10); |
250 module:hook("s2sout-stream-features", function (event) | |
251 if stanza_size_limit then | |
252 event.features:tag("limits", { xmlns = "urn:xmpp:stream-limits:0" }) | |
253 :text_tag("max-size", string.format("%d", stanza_size_limit)):up(); | |
254 end | |
255 end); | |
250 module:hook("s2s-authenticated", make_authenticated, -1); | 256 module:hook("s2s-authenticated", make_authenticated, -1); |
251 module:hook("s2s-read-timeout", keepalive, -1); | 257 module:hook("s2s-read-timeout", keepalive, -1); |
252 module:hook_stanza("http://etherx.jabber.org/streams", "features", function (session, stanza) -- luacheck: ignore 212/stanza | 258 module:hook_stanza("http://etherx.jabber.org/streams", "features", function (session, stanza) -- luacheck: ignore 212/stanza |
253 local limits = stanza:get_child("limits", "urn:xmpp:stream-limits:0"); | 259 local limits = stanza:get_child("limits", "urn:xmpp:stream-limits:0"); |
254 if limits then | 260 if limits then |