finger: dedup results
This commit is contained in:
@@ -166,7 +166,6 @@ impl VarlinkRoowhoo2ClientServer {
|
||||
_disable_user_account_db: bool,
|
||||
) -> VarlinkFingerResponse {
|
||||
match user_queries {
|
||||
// TODO: deduplicate results
|
||||
Some(usernames) => usernames
|
||||
.into_iter()
|
||||
.flat_map::<Vec<_>, _>(|username| {
|
||||
@@ -175,6 +174,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) => {
|
||||
|
||||
Reference in New Issue
Block a user