aboutsummaryrefslogtreecommitdiffstats
path: root/filamento/src/logic/offline.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2025-04-11 00:49:36 +0100
committerLibravatar cel 🌸 <cel@bunny.garden>2025-04-11 00:49:36 +0100
commitaab4cd47b1d2da5539c50675be4c7a36898189ef (patch)
tree3338bab6b08a076c8b39e8c3cb06a22f40a66e04 /filamento/src/logic/offline.rs
parentaf7a0f5022dfd0e04c821f0d4fc8314b3578417c (diff)
downloadluz-aab4cd47b1d2da5539c50675be4c7a36898189ef.tar.gz
luz-aab4cd47b1d2da5539c50675be4c7a36898189ef.tar.bz2
luz-aab4cd47b1d2da5539c50675be4c7a36898189ef.zip
feat(filamento): `get_roster_with_users()`
Diffstat (limited to 'filamento/src/logic/offline.rs')
-rw-r--r--filamento/src/logic/offline.rs11
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);