From bf9eae2187333a54aff5f7aefe1f69567326860e Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Thu, 28 Dec 2023 22:22:35 -0500 Subject: [PATCH] wtf --- src/main.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index aacee06..814dfa1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -98,12 +98,19 @@ async fn main() -> Result<()> { let mut lines = reader.lines(); let mut client = Client::new(context.bare_me.clone(), &cfg.password); - client.set_reconnect(true); + // client.set_reconnect(true); loop { tokio::select! { - Some(event) = client.next() => handle_xmpp(event, &mut client, &context).await?, + event = client.next() => { + println!("got event: {event:?}"); + match event { + Some(event) => handle_xmpp(event, &mut client, &context).await?, + None => break, + } + } Ok(Some(line)) = lines.next_line() => { + println!("got line"); if handle_line(line, &mut client, &context).await? { break; } @@ -111,9 +118,13 @@ async fn main() -> Result<()> { } } + println!("NOTICE: kiss-xmpp exiting, goodbye!"); // Close client connection - client.send_end().await.ok(); // ignore errors here, I guess + // client.send_end().await.ok(); // ignore errors here, I guess + drop(client); + drop(lines); + println!("ok really quitting"); Ok(()) }