From 2c95fd678643d5d7bac0d1237de636c5b159a867 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 23 Apr 2017 18:38:53 +0100 Subject: [PATCH] presence: Add ecaps2 as a possible payload. --- src/presence.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/presence.rs b/src/presence.rs index 51e5854e..bb3334ef 100644 --- a/src/presence.rs +++ b/src/presence.rs @@ -10,11 +10,13 @@ use error::Error; use ns; use delay; +use ecaps2; /// Lists every known payload of a ``. #[derive(Debug, Clone)] pub enum PresencePayload { Delay(delay::Delay), + ECaps2(ecaps2::ECaps2), } #[derive(Debug, Clone, PartialEq)] @@ -104,6 +106,8 @@ pub fn parse_presence(root: &Element) -> Result { for elem in root.children() { let payload = if let Ok(delay) = delay::parse_delay(elem) { Some(PresencePayload::Delay(delay)) + } else if let Ok(ecaps2) = ecaps2::parse_ecaps2(elem) { + Some(PresencePayload::ECaps2(ecaps2)) } else { None }; @@ -124,6 +128,7 @@ pub fn parse_presence(root: &Element) -> Result { pub fn serialise_payload(payload: &PresencePayload) -> Element { match *payload { PresencePayload::Delay(ref delay) => delay::serialise(delay), + PresencePayload::ECaps2(ref ecaps2) => ecaps2::serialise(ecaps2), } }