Can now connect to Omikron :C
Some util
This commit is contained in:
parent
8b21e451dd
commit
9bd22d4e3e
16 changed files with 1508 additions and 199 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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> {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
Loading…
Reference in a new issue