diff options
Diffstat (limited to 'filamento/src/logic')
-rw-r--r-- | filamento/src/logic/local_only.rs | 9 | ||||
-rw-r--r-- | filamento/src/logic/offline.rs | 8 | ||||
-rw-r--r-- | filamento/src/logic/online.rs | 7 | ||||
-rw-r--r-- | filamento/src/logic/process_stanza.rs | 1 |
4 files changed, 20 insertions, 5 deletions
diff --git a/filamento/src/logic/local_only.rs b/filamento/src/logic/local_only.rs index 9db9d4d..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, diff --git a/filamento/src/logic/offline.rs b/filamento/src/logic/offline.rs index 9f1a3bc..b87484c 100644 --- a/filamento/src/logic/offline.rs +++ b/filamento/src/logic/offline.rs @@ -23,7 +23,8 @@ use super::{ local_only::{ handle_delete_chat, handle_delete_messaage, handle_get_chat, handle_get_chats, handle_get_chats_ordered, handle_get_chats_ordered_with_latest_messages, - handle_get_messages, handle_get_messages_with_users, handle_get_user, + handle_get_chats_ordered_with_latest_messages_and_users, handle_get_messages, + handle_get_messages_with_users, handle_get_user, }, }; @@ -80,6 +81,10 @@ pub async fn handle_offline_result<Fs: FileStore + Clone>( let chats = handle_get_chats_ordered_with_latest_messages(logic).await; sender.send(chats); } + Command::GetChatsOrderedWithLatestMessagesAndUsers(sender) => { + let chats = handle_get_chats_ordered_with_latest_messages_and_users(logic).await; + sender.send(chats); + } Command::GetChat(jid, sender) => { let chats = handle_get_chat(logic, jid).await; sender.send(chats); @@ -176,7 +181,6 @@ pub async fn handle_offline_result<Fs: FileStore + Clone>( jid: logic.bare_jid.clone(), nick: None, avatar: None, - cached_status_message: None, } } }; diff --git a/filamento/src/logic/online.rs b/filamento/src/logic/online.rs index 2cf2d5c..c560b9b 100644 --- a/filamento/src/logic/online.rs +++ b/filamento/src/logic/online.rs @@ -23,7 +23,7 @@ use crate::{ use super::{ local_only::{ - handle_delete_chat, handle_delete_messaage, handle_get_chat, handle_get_chats, handle_get_chats_ordered, handle_get_chats_ordered_with_latest_messages, handle_get_messages, handle_get_messages_with_users, handle_get_user + handle_delete_chat, handle_delete_messaage, handle_get_chat, handle_get_chats, handle_get_chats_ordered, handle_get_chats_ordered_with_latest_messages, handle_get_chats_ordered_with_latest_messages_and_users, handle_get_messages, handle_get_messages_with_users, handle_get_user }, ClientLogic }; @@ -487,7 +487,6 @@ pub async fn handle_send_message<Fs: FileStore + Clone>(logic: &ClientLogic<Fs>, jid: logic.bare_jid.clone(), nick: None, avatar: None, - cached_status_message: None, } }, }; @@ -1047,6 +1046,10 @@ pub async fn handle_online_result<Fs: FileStore + Clone>( let chats = handle_get_chats_ordered_with_latest_messages(logic).await; let _ = sender.send(chats); } + Command::GetChatsOrderedWithLatestMessagesAndUsers(sender) => { + let chats = handle_get_chats_ordered_with_latest_messages_and_users(logic).await; + sender.send(chats); + } Command::GetChat(jid, sender) => { let chat = handle_get_chat(logic, jid).await; let _ = sender.send(chat); diff --git a/filamento/src/logic/process_stanza.rs b/filamento/src/logic/process_stanza.rs index 1a29f70..cdaff97 100644 --- a/filamento/src/logic/process_stanza.rs +++ b/filamento/src/logic/process_stanza.rs @@ -112,7 +112,6 @@ pub async fn recv_message<Fs: FileStore + Clone>( jid: from.as_bare(), nick: None, avatar: None, - cached_status_message: None, } } }; |