diff options
Diffstat (limited to 'filamento/src/logic/local_only.rs')
-rw-r--r-- | filamento/src/logic/local_only.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/filamento/src/logic/local_only.rs b/filamento/src/logic/local_only.rs index cabbef4..dc94d2c 100644 --- a/filamento/src/logic/local_only.rs +++ b/filamento/src/logic/local_only.rs @@ -28,6 +28,15 @@ pub async fn handle_get_chats_ordered_with_latest_messages<Fs: FileStore + Clone Ok(logic.db().read_chats_ordered_with_latest_messages().await?) } +pub async fn handle_get_chats_ordered_with_latest_messages_and_users<Fs: FileStore + Clone>( + logic: &ClientLogic<Fs>, +) -> Result<Vec<((Chat, User), (Message, User))>, DatabaseError> { + Ok(logic + .db() + .read_chats_ordered_with_latest_messages_and_users() + .await?) +} + pub async fn handle_get_chat<Fs: FileStore + Clone>( logic: &ClientLogic<Fs>, jid: JID, @@ -42,6 +51,13 @@ pub async fn handle_get_messages<Fs: FileStore + Clone>( Ok(logic.db().read_message_history(jid).await?) } +pub async fn handle_get_messages_with_users<Fs: FileStore + Clone>( + logic: &ClientLogic<Fs>, + jid: JID, +) -> 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, |