mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Respect description privacy when searching members
This commit is contained in:
parent
56eae82b0a
commit
dd9cc3ef0c
3 changed files with 21 additions and 7 deletions
|
|
@ -54,12 +54,12 @@ namespace PluralKit.Bot
|
|||
|
||||
public async Task<IEnumerable<ListedMember>> Execute(IPKConnection conn, PKSystem system, LookupContext ctx)
|
||||
{
|
||||
var filtered = await QueryWithFilter(conn, system);
|
||||
var filtered = await QueryWithFilter(conn, system, ctx);
|
||||
return Sort(filtered, ctx);
|
||||
}
|
||||
|
||||
private Task<IEnumerable<ListedMember>> QueryWithFilter(IPKConnection conn, PKSystem system) =>
|
||||
conn.QueryMemberList(system.Id, PrivacyFilter switch
|
||||
private Task<IEnumerable<ListedMember>> QueryWithFilter(IPKConnection conn, PKSystem system, LookupContext ctx) =>
|
||||
conn.QueryMemberList(system.Id, ctx, PrivacyFilter switch
|
||||
{
|
||||
PrivacyFilter.PrivateOnly => PrivacyLevel.Private,
|
||||
PrivacyFilter.PublicOnly => PrivacyLevel.Public,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue