Can now connect to Omikron :C

Some util
This commit is contained in:
Alex Emmet 2025-09-05 23:00:24 +02:00
commit 9bd22d4e3e
16 changed files with 1508 additions and 199 deletions

View file

@ -134,8 +134,8 @@ impl ChatFiles {
pub fn get_messages(
storage_owner: Uuid,
external_user: Uuid,
loaded_messages: usize,
amount: usize,
loaded_messages: i64,
amount: i64,
) -> JsonValue {
let user_dir = format!("users/{}/chats/{}", storage_owner, external_user);
let path = Path::new(&user_dir);

View file

@ -31,7 +31,7 @@ impl ChatsUtil {
file.write_all(content.as_bytes())
}
pub fn mod_user(storage_owner: Uuid, contact: Contact) -> std::io::Result<()> {
pub fn mod_user(storage_owner: Uuid, contact: &Contact){
let dir = format!("users/{}/contacts/", storage_owner);
let file_name = "contacts.json";
let s = Self::load_file(&dir, file_name);
@ -50,7 +50,7 @@ impl ChatsUtil {
}
contacts.push(contact.to_json()).unwrap();
Self::save_file(&dir, file_name, &contacts.dump())
Self::save_file(&dir, file_name, &contacts.dump());
}
pub fn get_user(storage_owner: Uuid, user_id: Uuid) -> Option<Contact> {

View file

@ -1,4 +1,4 @@
pub mod fileUtil;
pub mod chatFiles;
pub mod configUtil;
pub mod chatsUtil;
pub mod file_util;
pub mod chat_files;
pub mod config_util;
pub mod chats_util;