diff options
Diffstat (limited to 'filamento/src/logic/offline.rs')
-rw-r--r-- | filamento/src/logic/offline.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/filamento/src/logic/offline.rs b/filamento/src/logic/offline.rs index 566972c..82b3298 100644 --- a/filamento/src/logic/offline.rs +++ b/filamento/src/logic/offline.rs @@ -14,6 +14,7 @@ use crate::{ files::FileStore, presence::Online, roster::Contact, + user::User, }; use super::{ @@ -47,6 +48,12 @@ pub async fn handle_get_roster<Fs: FileStore + Clone>( Ok(logic.db().read_cached_roster().await?) } +pub async fn handle_get_roster_with_users<Fs: FileStore + Clone>( + logic: &ClientLogic<Fs>, +) -> Result<Vec<(Contact, User)>, RosterError> { + Ok(logic.db().read_cached_roster_with_users().await?) +} + pub async fn handle_offline_result<Fs: FileStore + Clone>( logic: &ClientLogic<Fs>, command: Command<Fs>, @@ -56,6 +63,10 @@ pub async fn handle_offline_result<Fs: FileStore + Clone>( let roster = handle_get_roster(logic).await; sender.send(roster); } + Command::GetRosterWithUsers(sender) => { + let roster = handle_get_roster_with_users(logic).await; + sender.send(roster); + } Command::GetChats(sender) => { let chats = handle_get_chats(logic).await; sender.send(chats); |