aboutsummaryrefslogtreecommitdiffstats
path: root/filamento/src/logic/local_only.rs
diff options
context:
space:
mode:
Diffstat (limited to 'filamento/src/logic/local_only.rs')
-rw-r--r--filamento/src/logic/local_only.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/filamento/src/logic/local_only.rs b/filamento/src/logic/local_only.rs
index f5705f4..7f3a2e6 100644
--- a/filamento/src/logic/local_only.rs
+++ b/filamento/src/logic/local_only.rs
@@ -1,4 +1,4 @@
-use jid::JID;
+use jid::{BareJID, JID};
use uuid::Uuid;
use crate::{
@@ -39,14 +39,14 @@ pub async fn handle_get_chats_ordered_with_latest_messages_and_users<Fs: FileSto
pub async fn handle_get_chat<Fs: FileStore + Clone>(
logic: &ClientLogic<Fs>,
- jid: JID,
+ jid: BareJID,
) -> Result<Chat, DatabaseError> {
Ok(logic.db().read_chat(jid).await?)
}
pub async fn handle_get_chat_and_user<Fs: FileStore + Clone>(
logic: &ClientLogic<Fs>,
- jid: JID,
+ jid: BareJID,
) -> Result<(Chat, User), DatabaseError> {
Ok(logic.db().read_chat_and_user(jid).await?)
}
@@ -60,21 +60,21 @@ pub async fn handle_get_message<Fs: FileStore + Clone>(
pub async fn handle_get_messages<Fs: FileStore + Clone>(
logic: &ClientLogic<Fs>,
- jid: JID,
+ jid: BareJID,
) -> Result<Vec<Message>, DatabaseError> {
Ok(logic.db().read_message_history(jid).await?)
}
pub async fn handle_get_messages_with_users<Fs: FileStore + Clone>(
logic: &ClientLogic<Fs>,
- jid: JID,
+ jid: BareJID,
) -> Result<Vec<(Message, User)>, DatabaseError> {
Ok(logic.db().read_message_history_with_users(jid).await?)
}
pub async fn handle_delete_chat<Fs: FileStore + Clone>(
logic: &ClientLogic<Fs>,
- jid: JID,
+ jid: BareJID,
) -> Result<(), DatabaseError> {
Ok(logic.db().delete_chat(jid).await?)
}
@@ -88,7 +88,7 @@ pub async fn handle_delete_messaage<Fs: FileStore + Clone>(
pub async fn handle_get_user<Fs: FileStore + Clone>(
logic: &ClientLogic<Fs>,
- jid: JID,
+ jid: BareJID,
) -> Result<User, DatabaseError> {
Ok(logic.db().read_user(jid).await?)
}