∅:D[
3.1084] → [
3.1084:2255]
∅:D[
3.1084] → [
3.1084:2255]
∅:D[
3.2255] → [
2.330:431]
∅:D[
2.431] → [
3.2596:2775]
∅:D[
3.2596] → [
3.2596:2775]
∅:D[
3.2775] → [
2.432:529]
∅:D[
2.529] → [
3.3092:3191]
∅:D[
3.3092] → [
3.3092:3191]
let (sink, stream) = client.split();
Box::new(future::loop_fn(
(sink, stream, account),
|(sink, stream, account)| {
stream.into_future().then(|r| match r {
Ok((event, stream)) => match event {
Some(Event::Online) => {
info!("Online");
future::ok(future::Loop::Break(future::Loop::Break(
XmppConnection {
account,
inner: Some((sink, stream)),
},
)))
}
Some(Event::Stanza(s)) => {
info!("xmpp stanza: {:?}", s);
future::ok(future::Loop::Continue((sink, stream, account)))
}
_ => {
warn!("Disconnected");
future::ok(future::Loop::Break(future::Loop::Continue(account)))
}
},
Err((e, _)) => {
error!("xmpp receive error: {}", e);
future::ok(future::Loop::Break(future::Loop::Continue(account)))
}
})
},
))
Self::online(client.split(), account).then(|r| match r {
Ok(conn) => future::ok(future::Loop::Break(conn)),
Err(acc) => future::ok(future::Loop::Continue(acc)),
})