xmpp-rs: update tokio_xmpp API
This commit is contained in:
parent
1e1f593233
commit
91f4548ef0
1 changed files with 4 additions and 3 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue