diff --git a/apps/mtxchat/src/lib.rs b/apps/mtxchat/src/lib.rs
index a5499d18e..8a84a31ed 100644
--- a/apps/mtxchat/src/lib.rs
+++ b/apps/mtxchat/src/lib.rs
@@ -77,6 +77,17 @@ impl MtxChat {
filter: EMPTY.to_string(),
since: EMPTY.to_string(),
};
+ let mut keypath = PathBuf::new();
+ keypath.push(MTXCHAT_DICT);
+ if std::fs::metadata(&keypath).is_ok() { // keypath exists
+ // log::info!("dict '{}' exists", MTXCHAT_DICT);
+ } else {
+ log::info!("dict '{}' does NOT exist.. creating it", MTXCHAT_DICT);
+ match std::fs::create_dir_all(&keypath){
+ Ok(_) => log::info!("created dict: {}", MTXCHAT_DICT),
+ Err(e) => log::warn!("failed to create dict: {:?}", e),
+ }
+ }
common
}
@@ -247,18 +258,12 @@ impl MtxChat {
}
}
- pub fn get(&mut self, key: &str) -> Result