∅:D[
4.2767] → [
2.5606:5704]
∅:D[
2.5704] → [
4.2865:2899]
∅:D[
5.860] → [
4.2865:2899]
∅:D[
4.2865] → [
4.2865:2899]
∅:D[
4.2899] → [
2.5705:5892]
∅:D[
2.5892] → [
4.3086:3180]
∅:D[
5.1051] → [
4.3086:3180]
∅:D[
4.3086] → [
4.3086:3180]
∅:D[
4.3180] → [
2.5893:5969]
∅:D[
2.5969] → [
4.3256:3297]
∅:D[
5.1133] → [
4.3256:3297]
∅:D[
4.3256] → [
4.3256:3297]
∅:D[
4.3297] → [
2.5970:6017]
∅:D[
2.6017] → [
4.3344:3513]
∅:D[
5.1195] → [
4.3344:3513]
∅:D[
4.3344] → [
4.3344:3513]
∅:D[
4.3513] → [
2.6018:6100]
∅:D[
2.6100] → [
4.3595:3899]
∅:D[
5.1284] → [
4.3595:3899]
∅:D[
4.3595] → [
4.3595:3899]
∅:D[
4.3899] → [
3.3237:3304]
∅:D[
6.832] → [
3.3237:3304]
∅:D[
7.1796] → [
3.3237:3304]
∅:D[
8.864] → [
3.3237:3304]
∅:D[
3.3237] → [
3.3237:3304]
∅:D[
3.3304] → [
4.3900:3945]
fn online(self) -> impl Future<Item = XmppConnection, Error = std::rc::Rc<config::Account>> {
Box::new(future::loop_fn(
(self.inner, self.account),
|(client, account)| {
client.into_future().then(|r| match r {
Ok((event, client)) => match event {
Some(Event::Online) => {
info!("Online");
future::ok(future::Loop::Break(XmppConnection {
account,
inner: client,
}))
}
Some(Event::Stanza(s)) => {
info!("xmpp stanza: {:?}", s);
future::ok(future::Loop::Continue((client, account)))
}
_ => {
warn!("Disconnected");
future::err(account)
}
},
Err((e, _)) => {
error!("xmpp receive error: {}", e);
future::err(account)
}
})
},
))
fn online(&mut self, event: &Event) -> Result<bool, failure::Error> {
match event {
Event::Online => {
info!("Online!");
Ok(true)
}
Event::Stanza(s) => {
warn!("Stanza before online: {:?}", s);
Ok(false)
}
_ => {
error!("Disconnected while online");
Err(format_err!("Disconnected while online"))
}
}