From c6bdf077b82b30f8228b56702bd3ee71d92b3910 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Sun, 1 Jun 2025 13:31:52 +0100 Subject: refactor: utilise new jid type safety --- filamento/src/logic/local_only.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'filamento/src/logic/local_only.rs') 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( logic: &ClientLogic, - jid: JID, + jid: BareJID, ) -> Result { Ok(logic.db().read_chat(jid).await?) } pub async fn handle_get_chat_and_user( logic: &ClientLogic, - 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( pub async fn handle_get_messages( logic: &ClientLogic, - jid: JID, + jid: BareJID, ) -> Result, DatabaseError> { Ok(logic.db().read_message_history(jid).await?) } pub async fn handle_get_messages_with_users( logic: &ClientLogic, - jid: JID, + jid: BareJID, ) -> Result, DatabaseError> { Ok(logic.db().read_message_history_with_users(jid).await?) } pub async fn handle_delete_chat( logic: &ClientLogic, - jid: JID, + jid: BareJID, ) -> Result<(), DatabaseError> { Ok(logic.db().delete_chat(jid).await?) } @@ -88,7 +88,7 @@ pub async fn handle_delete_messaage( pub async fn handle_get_user( logic: &ClientLogic, - jid: JID, + jid: BareJID, ) -> Result { Ok(logic.db().read_user(jid).await?) } -- cgit