Revert "xmpp-parsers: Support required in SM feature"
This reverts commit 4e0cd5d96b.
This commit is contained in:
parent
4e0cd5d96b
commit
dc2477eec3
3 changed files with 6 additions and 19 deletions
|
|
@ -108,8 +108,7 @@ XXXX-YY-ZZ RELEASER <admin@example.com>
|
|||
- Push Notifications (XEP-0357) (!543)
|
||||
- JSON Containers (XEP-0335) (!546)
|
||||
* Improvements:
|
||||
- Add support for `<optional/>` and `<required/>` in XEP-0198 feature
|
||||
advertisment.
|
||||
- Add support for `<optional/> in XEP-0198 feature advertisment
|
||||
- Add support application-specific error conditions in XEP-0198
|
||||
- Keep unsupported vCard elements as `minidom::Element`, so that they
|
||||
get serialized back instead of being dropped. We now also test for
|
||||
|
|
|
|||
|
|
@ -269,13 +269,7 @@ mod tests {
|
|||
|
||||
let inline = auth.inline.unwrap();
|
||||
assert_eq!(inline.bind2.unwrap().inline_features.len(), 0);
|
||||
assert_eq!(
|
||||
inline.sm.unwrap(),
|
||||
StreamManagement {
|
||||
optional: false,
|
||||
required: false
|
||||
}
|
||||
);
|
||||
assert_eq!(inline.sm.unwrap(), StreamManagement { optional: false });
|
||||
assert_eq!(inline.payloads.len(), 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ pub struct Resumed {
|
|||
pub previd: StreamId,
|
||||
}
|
||||
|
||||
// TODO: Only allow either optional or required, not both.
|
||||
// TODO: add support for optional and required.
|
||||
/// Represents availability of Stream Management in `<stream:features/>`.
|
||||
#[derive(FromXml, AsXml, PartialEq, Debug, Clone)]
|
||||
#[xml(namespace = ns::SM, name = "sm")]
|
||||
|
|
@ -141,10 +141,6 @@ pub struct StreamManagement {
|
|||
/// `<optional/>` flag.
|
||||
#[xml(flag)]
|
||||
pub optional: bool,
|
||||
|
||||
/// `<required/>` flag.
|
||||
#[xml(flag)]
|
||||
pub required: bool,
|
||||
}
|
||||
|
||||
/// Application-specific error condition to use when the peer acknowledges
|
||||
|
|
@ -226,7 +222,7 @@ mod tests {
|
|||
assert_size!(R, 0);
|
||||
assert_size!(Resume, 16);
|
||||
assert_size!(Resumed, 16);
|
||||
assert_size!(StreamManagement, 2);
|
||||
assert_size!(StreamManagement, 1);
|
||||
assert_size!(HandledCountTooHigh, 8);
|
||||
}
|
||||
|
||||
|
|
@ -241,7 +237,7 @@ mod tests {
|
|||
assert_size!(R, 0);
|
||||
assert_size!(Resume, 32);
|
||||
assert_size!(Resumed, 32);
|
||||
assert_size!(StreamManagement, 2);
|
||||
assert_size!(StreamManagement, 1);
|
||||
assert_size!(HandledCountTooHigh, 8);
|
||||
}
|
||||
|
||||
|
|
@ -255,9 +251,7 @@ mod tests {
|
|||
#[test]
|
||||
fn stream_feature() {
|
||||
let elem: Element = "<sm xmlns='urn:xmpp:sm:3'/>".parse().unwrap();
|
||||
let sm = StreamManagement::try_from(elem).unwrap();
|
||||
assert_eq!(sm.optional, false);
|
||||
assert_eq!(sm.required, false);
|
||||
StreamManagement::try_from(elem).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue