xmpp-parsers: Implement XEP-0478: Stream Limits Advertisement
This allows servers to communicate their maximum stanza limit, as well as idle time limit.
This commit is contained in:
parent
9960cfd965
commit
d8e08df464
6 changed files with 96 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ use xso::{AsXml, FromXml};
|
|||
|
||||
use crate::bind::BindFeature;
|
||||
use crate::ns;
|
||||
use crate::stream_limits::Limits;
|
||||
|
||||
/// Wraps `<stream:features/>`, usually the very first nonza of a
|
||||
/// XMPP stream. Indicates which features are supported.
|
||||
|
|
@ -27,6 +28,10 @@ pub struct StreamFeatures {
|
|||
#[xml(child(default))]
|
||||
pub sasl_mechanisms: SaslMechanisms,
|
||||
|
||||
/// Limits advertised by the server.
|
||||
#[xml(child(default))]
|
||||
pub limits: Option<Limits>,
|
||||
|
||||
/// Other stream features advertised
|
||||
///
|
||||
/// If some features you use end up here, you may want to contribute
|
||||
|
|
@ -91,7 +96,7 @@ mod tests {
|
|||
assert_size!(SaslMechanisms, 12);
|
||||
assert_size!(RequiredStartTls, 0);
|
||||
assert_size!(StartTls, 1);
|
||||
assert_size!(StreamFeatures, 28);
|
||||
assert_size!(StreamFeatures, 40);
|
||||
}
|
||||
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
|
|
@ -101,7 +106,7 @@ mod tests {
|
|||
assert_size!(SaslMechanisms, 24);
|
||||
assert_size!(RequiredStartTls, 0);
|
||||
assert_size!(StartTls, 1);
|
||||
assert_size!(StreamFeatures, 56);
|
||||
assert_size!(StreamFeatures, 64);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue