From 1a8ea2e38313e94fdfebe3b5a335669bdd8e1131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Tue, 26 Dec 2017 20:55:19 +0000 Subject: [PATCH] plugins/messaging: Body, Thread, Subject are now structs --- src/plugins/messaging.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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