mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
delay: Correctly parse the content data.
This commit is contained in:
parent
cfadff3bc9
commit
d39d13b7cb
1 changed files with 5 additions and 1 deletions
|
@ -20,10 +20,14 @@ pub fn parse_delay(root: &Element) -> Result<Delay, Error> {
|
|||
}
|
||||
let from = root.attr("from").and_then(|value| value.parse().ok());
|
||||
let stamp = root.attr("stamp").ok_or(Error::ParseError("Mandatory argument 'stamp' not present in delay element."))?.to_owned();
|
||||
let data = match root.text().as_ref() {
|
||||
"" => None,
|
||||
text => Some(text.to_owned()),
|
||||
};
|
||||
Ok(Delay {
|
||||
from: from,
|
||||
stamp: stamp,
|
||||
data: None,
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue