message, iq, presence, stanza_error, forwarded: Add support for components hidden behind the component feature flag.

This commit is contained in:
Emmanuel Gil Peyrot 2017-07-29 06:49:02 +01:00
commit 69cc83c456
8 changed files with 161 additions and 28 deletions

View file

@ -242,6 +242,7 @@ mod tests {
#[test]
fn test_result() {
#[cfg(not(feature = "component"))]
let elem: Element = r#"
<result xmlns='urn:xmpp:mam:2' queryid='f27' id='28482-98726-73623'>
<forwarded xmlns='urn:xmpp:forward:0'>
@ -251,6 +252,17 @@ mod tests {
</message>
</forwarded>
</result>
"#.parse().unwrap();
#[cfg(feature = "component")]
let elem: Element = r#"
<result xmlns='urn:xmpp:mam:2' queryid='f27' id='28482-98726-73623'>
<forwarded xmlns='urn:xmpp:forward:0'>
<delay xmlns='urn:xmpp:delay' stamp='2010-07-10T23:08:25Z'/>
<message xmlns='jabber:component:accept' from="witch@shakespeare.lit" to="macbeth@shakespeare.lit">
<body>Hail to thee</body>
</message>
</forwarded>
</result>
"#.parse().unwrap();
Result_::try_from(elem).unwrap();
}