diff --git a/src/plugins/messaging.rs b/src/plugins/messaging.rs index 8ac5517..9da0d2a 100644 --- a/src/plugins/messaging.rs +++ b/src/plugins/messaging.rs @@ -7,7 +7,7 @@ use error::Error; use jid::Jid; use plugins::stanza::Message; -use xmpp_parsers::message::{MessagePayload, MessageType}; +use xmpp_parsers::message::{MessagePayload, MessageType, Body}; use xmpp_parsers::chatstates::ChatState; use xmpp_parsers::receipts::{Request, Received}; use xmpp_parsers::stanza_id::StanzaId; @@ -70,7 +70,7 @@ impl MessagingPlugin { id: Some(self.proxy.gen_id()), bodies: { let mut bodies = BTreeMap::new(); - bodies.insert(String::new(), String::from(body)); + bodies.insert(String::new(), Body(body.to_owned())); bodies }, subjects: BTreeMap::new(), @@ -118,9 +118,9 @@ impl MessagingPlugin { if message.bodies.contains_key("") { self.proxy.dispatch(MessageEvent { from: from, - body: message.bodies[""].clone(), - subject: if message.subjects.contains_key("") { Some(message.subjects[""].clone()) } else { None }, - thread: message.thread.clone(), + body: message.bodies[""].clone().0, + subject: if message.subjects.contains_key("") { Some(message.subjects[""].clone().0) } else { None }, + thread: match message.thread.clone() { Some(thread) => Some(thread.0), None => None }, }); } Propagation::Stop