diff --git a/src/main.rs b/src/main.rs index 356051c..c7f063c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -79,12 +79,12 @@ async fn main() -> anyhow::Result<()> { matrix_client: Arc::new(client.clone()), }; - eprintln!("Logging in!"); - if config.matrix_persist.exists() { + eprintln!("Restoring Matrix session..."); let session: Session = serde_json::from_reader(File::open(config.matrix_persist)?)?; client.restore_login(session).await?; } else { + eprintln!("Logging in!"); let session: Session = client .login( mxid.localpart(), @@ -94,6 +94,7 @@ async fn main() -> anyhow::Result<()> { ) .await? .into(); + eprintln!("Persisting Matrix session..."); serde_json::to_writer(File::create(config.matrix_persist)?, &session)?; }