From c71b32ae244d60323fc95322da85855adfaa2e4c Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 24 Apr 2017 19:25:00 +0100 Subject: [PATCH] ibb: Implement IntoAttributeValue for Stanza. --- src/ibb.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ibb.rs b/src/ibb.rs index 507e3aa4..ba8fcafb 100644 --- a/src/ibb.rs +++ b/src/ibb.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use minidom::Element; +use minidom::{Element, IntoAttributeValue}; use base64; use error::Error; @@ -32,6 +32,15 @@ impl FromStr for Stanza { } } +impl IntoAttributeValue for Stanza { + fn into_attribute_value(self) -> Option { + match self { + Stanza::Iq => None, + Stanza::Message => Some(String::from("message")), + } + } +} + #[derive(Debug, Clone)] pub enum IBB { Open {