Comparison

plugins/mod_c2s.lua @ 12808:12bd40b8e105

mod_c2s,mod_s2s: Adapt to XEP-xxxx: Stream Limits Advertisement Thanks MattJ
author Kim Alvefur <zash@zash.se>
date Thu, 20 Oct 2022 14:04:56 +0200
parent 12804:3eef052c72d8
child 12907:d2333b468d07
comparison
equal deleted inserted replaced
12807:f0f7b0c61465 12808:12bd40b8e105
130 local features = st.stanza("stream:features"); 130 local features = st.stanza("stream:features");
131 hosts[session.host].events.fire_event("stream-features", { origin = session, features = features, stream = attr }); 131 hosts[session.host].events.fire_event("stream-features", { origin = session, features = features, stream = attr });
132 if features.tags[1] or session.full_jid then 132 if features.tags[1] or session.full_jid then
133 if stanza_size_limit then 133 if stanza_size_limit then
134 features:reset(); 134 features:reset();
135 features:tag("stanza-size-limit", { xmlns = "xmpp:prosody.im/stream/limits", bytes = string.format("%d", stanza_size_limit) }); 135 features:tag("limits", { xmlns = "urn:xmpp:stream-limits:0" })
136 :text_tag("max-size", string.format("%d", stanza_size_limit)):up();
136 end 137 end
137 send(features); 138 send(features);
138 else 139 else
139 if session.secure then 140 if session.secure then
140 -- Here SASL should be offered 141 -- Here SASL should be offered