diff --git a/.gitignore b/.gitignore index 3afb0c8..5c08e5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /target -config.yaml \ No newline at end of file +config.yaml* \ No newline at end of file diff --git a/src/matrix.rs b/src/matrix.rs index 732d2ab..1c05a96 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -39,6 +39,11 @@ pub async fn get_clients(config: &mut Config) -> Vec { } } } + // If client is logged in, update the config to persist the session + if let Some(session) = client.session().await { + conf.access_token = Some(session.access_token); + conf.device_id = Some(session.device_id.to_string()); + } clients.push(client.clone()); }