diff --git a/Cargo.toml b/Cargo.toml index c6cd33b7..b6c9a710 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ native-tls = "*" tokio-tls = "*" sasl = "*" rustc-serialize = "*" -jid = "*" +jid = { version = "0.2.3", features = ["minidom"] } domain = "0.2.1" xmpp-parsers = "0.7.0" idna = "*" diff --git a/examples/echo_bot.rs b/examples/echo_bot.rs index 3f6a4ab5..2cb09a91 100644 --- a/examples/echo_bot.rs +++ b/examples/echo_bot.rs @@ -14,7 +14,7 @@ use futures::{Future, Stream, Sink, future}; use tokio_xmpp::Client; use minidom::Element; use xmpp_parsers::presence::{Presence, Type as PresenceType, Show as PresenceShow}; -use xmpp_parsers::message::{Message, MessageType}; +use xmpp_parsers::message::{Message, MessageType, Body}; use jid::Jid; fn main() { @@ -60,7 +60,7 @@ fn main() { match (message.from, message.bodies.get("")) { (Some(from), Some(body)) => if message.type_ != MessageType::Error { - let reply = make_reply(from, body); + let reply = make_reply(from, &body.0); send(reply); }, _ => (), @@ -91,6 +91,6 @@ fn make_presence() -> Element { // Construct a chat fn make_reply(to: Jid, body: &str) -> Element { let mut message = Message::new(Some(to)); - message.bodies.insert(String::new(), body.to_owned()); + message.bodies.insert(String::new(), Body(body.to_owned())); message.into() }