From 0d7074eb6e9d0abb4f1a23c21e5d30942695815f Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 28 May 2017 17:15:02 +0100 Subject: [PATCH] update the presence plugin to match xmpp-parsers 0.5.0 --- Cargo.toml | 2 +- examples/client.rs | 4 ++-- src/plugins/presence.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 673a37f..387c328 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ gitlab = { repository = "lumi/xmpp-rs" } [dependencies] xml-rs = "0.4.1" -xmpp-parsers = "0.4.0" +xmpp-parsers = "0.5.0" openssl = "0.9.12" base64 = "0.5.2" minidom = "0.4.1" diff --git a/examples/client.rs b/examples/client.rs index 93c2bcc..191021e 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -5,7 +5,7 @@ use xmpp::client::ClientBuilder; use xmpp::plugins::stanza::StanzaPlugin; use xmpp::plugins::unhandled_iq::UnhandledIqPlugin; use xmpp::plugins::messaging::{MessagingPlugin, MessageEvent}; -use xmpp::plugins::presence::{PresencePlugin, Type}; +use xmpp::plugins::presence::{PresencePlugin, Type, Show}; use xmpp::plugins::disco::DiscoPlugin; use xmpp::plugins::ibb::IbbPlugin; use xmpp::plugins::ping::PingPlugin; @@ -33,6 +33,6 @@ fn main() { println!("{:?}", e); Propagation::Continue }); - client.plugin::().set_presence(Type::Available, None, None).unwrap(); + client.plugin::().set_presence(Type::None, Show::None, None).unwrap(); client.main().unwrap(); } diff --git a/src/plugins/presence.rs b/src/plugins/presence.rs index 42ee94c..b0e57bd 100644 --- a/src/plugins/presence.rs +++ b/src/plugins/presence.rs @@ -3,7 +3,7 @@ use std::collections::BTreeMap; use error::Error; use plugin::PluginProxy; -pub use xmpp_parsers::presence::{Presence, PresenceType as Type, Show}; +pub use xmpp_parsers::presence::{Presence, Type, Show}; pub struct PresencePlugin { proxy: PluginProxy, @@ -16,7 +16,7 @@ impl PresencePlugin { } } - pub fn set_presence(&self, type_: Type, show: Option, status: Option) -> Result<(), Error> { + pub fn set_presence(&self, type_: Type, show: Show, status: Option) -> Result<(), Error> { let presence = Presence { from: None, to: None,