Compare commits

...

2 Commits

Author SHA1 Message Date
oysteikt 212f8b7104 finger: debug logging serverside
Build and test / check (push) Failing after 1m3s
Build and test / build (push) Failing after 1m22s
Build and test / test (push) Failing after 2m21s
Build and test / docs (push) Failing after 2m52s
2026-04-23 19:04:35 +09:00
oysteikt f5f079ac25 finger: dedup results 2026-04-23 19:04:35 +09:00
+12 -1
View File
@@ -136,6 +136,7 @@ impl VarlinkRoowhoo2ClientServer {
impl VarlinkRoowhoo2ClientServer {
// TODO: handle 'all' parameter
async fn handle_rwho_request(&self, _all: bool) -> VarlinkRwhoResponse {
tracing::debug!(all = _all, "Handling Rwho request");
let store = self.whod_status_store.read().await;
let mut all_user_entries = Vec::with_capacity(store.len());
@@ -153,6 +154,7 @@ impl VarlinkRoowhoo2ClientServer {
}
async fn handle_ruptime_request(&self) -> VarlinkRuptimeResponse {
tracing::debug!("Handling Ruptime request");
let store = self.whod_status_store.read().await;
store.values().cloned().collect()
}
@@ -165,8 +167,13 @@ impl VarlinkRoowhoo2ClientServer {
_request_networking: FingerRequestNetworking,
_disable_user_account_db: bool,
) -> VarlinkFingerResponse {
tracing::debug!(
user_queries = ?user_queries,
match_fullnames = match_fullnames,
request_info = ?request_info,
"Handling Finger request",
);
match user_queries {
// TODO: deduplicate results
Some(usernames) => usernames
.into_iter()
.flat_map::<Vec<_>, _>(|username| {
@@ -175,6 +182,10 @@ impl VarlinkRoowhoo2ClientServer {
.map(|res| (username.clone(), res))
.collect()
})
.dedup_by(|a, b| match (&a.1, &b.1) {
(Ok(user_a), Ok(user_b)) => user_a.username == user_b.username,
_ => false,
})
.filter_map(|(username, user)| match user {
Ok(user_info) => Some(user_info),
Err(err) => {