0
0
Fork 0
mirror of https://git.verdigado.com/NB-Public/simple-wkd.git synced 2024-12-06 14:52:41 +01:00

Add emails

This commit is contained in:
Delta1925 2023-04-14 12:18:49 +02:00
parent 5945294815
commit 9c35f4adef
No known key found for this signature in database
GPG key ID: 1C21ACE44193CB25
9 changed files with 149 additions and 41 deletions

View file

@ -9,8 +9,7 @@ use std::path::{Path, PathBuf};
#[macro_export]
macro_rules! pending_path {
() => {
Path::new(&SETTINGS.folder_structure.root_folder)
.join(&SETTINGS.folder_structure.pending_folder)
Path::new(&SETTINGS.root_folder).join(PENDING_FOLDER)
};
}
@ -54,7 +53,7 @@ pub fn get_user_file_path(email: &str) -> Result<PathBuf, Error> {
pub fn key_exists(email: &str) -> Result<bool, Error> {
let path = get_user_file_path(email)?;
if !pending_path!().join(path).is_file() {
if !Path::new(&SETTINGS.root_folder).join(path).is_file() {
return Err(Error::MissingKey);
}
Ok(true)