From 2b19a415d42751f5d2d985659ad553a51f7b3d02 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 24 Apr 2017 19:25:00 +0100 Subject: [PATCH] jingle_ibb: Implement serialise. --- src/jingle_ibb.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/jingle_ibb.rs b/src/jingle_ibb.rs index 4ab73e68..29590cba 100644 --- a/src/jingle_ibb.rs +++ b/src/jingle_ibb.rs @@ -44,6 +44,15 @@ pub fn parse_jingle_ibb(root: &Element) -> Result { } } +pub fn serialise(transport: &Transport) -> Element { + Element::builder("transport") + .ns(ns::JINGLE_IBB) + .attr("block-size", format!("{}", transport.block_size)) + .attr("sid", transport.sid.clone()) + .attr("stanza", transport.stanza.clone()) + .build() +} + #[cfg(test)] mod tests { use minidom::Element;