From 91f4548ef022a866fb410c10e659f2255e737df1 Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 30 May 2020 00:24:58 +0200 Subject: [PATCH] xmpp-rs: update tokio_xmpp API --- xmpp-rs/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xmpp-rs/src/lib.rs b/xmpp-rs/src/lib.rs index fdf0faf..ffe5980 100644 --- a/xmpp-rs/src/lib.rs +++ b/xmpp-rs/src/lib.rs @@ -10,7 +10,7 @@ use futures::stream::StreamExt; use std::cell::RefCell; use std::convert::TryFrom; use std::rc::Rc; -use tokio_xmpp::{Client as TokioXmppClient, Event as TokioXmppEvent}; +use tokio_xmpp::{AsyncClient as TokioXmppClient, Event as TokioXmppEvent}; use xmpp_parsers::{ bookmarks2::Conference, caps::{compute_disco, hash_caps, Caps}, @@ -241,7 +241,7 @@ impl Agent { let mut events = Vec::new(); match event { - TokioXmppEvent::Online(_) => { + TokioXmppEvent::Online { resumed: false, .. } => { let presence = Self::make_initial_presence(&self.disco, &self.node).into(); let _ = self.client.send_stanza(presence).await; events.push(Event::Online); @@ -260,6 +260,7 @@ impl Agent { Iq::from_get("bookmarks", PubSub::Items(Items::new(ns::BOOKMARKS2))).into(); let _ = self.client.send_stanza(iq).await; } + TokioXmppEvent::Online { resumed: true, .. } => {} TokioXmppEvent::Disconnected(_) => { events.push(Event::Disconnected); } @@ -398,7 +399,7 @@ impl Agent { #[cfg(test)] mod tests { use super::{Agent, ClientBuilder, ClientFeature, ClientType, Event}; - use tokio_xmpp::Client as TokioXmppClient; + use tokio_xmpp::AsyncClient as TokioXmppClient; #[tokio::test] async fn test_simple() {