bot: don't clutter matrix state dir with session

This commit is contained in:
Antoine Martin 2021-09-12 15:19:50 +02:00
parent c24ae3e7a9
commit ff398e2c15

View file

@ -1,6 +1,7 @@
use std::{ use std::{
fs::File, fs::File,
io::{BufReader, BufWriter}, io::{BufReader, BufWriter},
path::PathBuf,
}; };
use matrix_sdk::{ use matrix_sdk::{
@ -66,7 +67,7 @@ impl Prololo {
/// file is found, then login using username and password, and save the new session information on /// file is found, then login using username and password, and save the new session information on
/// disk. /// disk.
async fn load_or_init_session(&self) -> anyhow::Result<()> { async fn load_or_init_session(&self) -> anyhow::Result<()> {
let session_file = self.config.matrix_state_dir.join("session.yaml"); let session_file = PathBuf::from("matrix-session.yaml");
if session_file.is_file() { if session_file.is_file() {
let reader = BufReader::new(File::open(session_file)?); let reader = BufReader::new(File::open(session_file)?);