improvement: user dir search also searches in displaynames
This commit is contained in:
parent
56dd6cb16f
commit
f0aed35ecf
2 changed files with 11 additions and 5 deletions
|
@ -1205,11 +1205,18 @@ pub fn search_users_route(
|
||||||
.users
|
.users
|
||||||
.iter()
|
.iter()
|
||||||
.map(Result::unwrap)
|
.map(Result::unwrap)
|
||||||
.filter(|user_id| user_id.to_string().contains(&body.search_term))
|
|
||||||
.map(|user_id| search_users::User {
|
.map(|user_id| search_users::User {
|
||||||
user_id,
|
user_id: user_id.clone(),
|
||||||
display_name: None,
|
display_name: db.users.displayname(&user_id).unwrap(),
|
||||||
avatar_url: None,
|
avatar_url: db.users.avatar_url(&user_id).unwrap(),
|
||||||
|
})
|
||||||
|
.filter(|user| {
|
||||||
|
user.user_id.to_string().contains(&body.search_term)
|
||||||
|
|| user
|
||||||
|
.display_name
|
||||||
|
.as_ref()
|
||||||
|
.filter(|name| name.contains(&body.search_term))
|
||||||
|
.is_some()
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
limited: false,
|
limited: false,
|
||||||
|
|
|
@ -113,7 +113,6 @@ impl AccountData {
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
let (kind, data) = r.unwrap();
|
let (kind, data) = r.unwrap();
|
||||||
&data.deserialize();
|
|
||||||
userdata.insert(kind, data);
|
userdata.insert(kind, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue