mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat: don't try to match other systems' members in switch / group add commands
This commit is contained in:
parent
dec228d5bd
commit
a2bf70b395
4 changed files with 22 additions and 17 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#nullable enable
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
|
@ -11,8 +12,11 @@ namespace PluralKit.Core
|
|||
public Task<PKMember?> GetMember(IPKConnection conn, MemberId id) =>
|
||||
conn.QueryFirstOrDefaultAsync<PKMember?>("select * from members where id = @id", new { id });
|
||||
|
||||
public Task<PKMember?> GetMemberByHid(IPKConnection conn, string hid) =>
|
||||
conn.QuerySingleOrDefaultAsync<PKMember?>("select * from members where hid = @Hid", new { Hid = hid.ToLower() });
|
||||
public Task<PKMember?> GetMemberByHid(IPKConnection conn, string hid, SystemId? system = null)
|
||||
=> conn.QuerySingleOrDefaultAsync<PKMember?>(
|
||||
"select * from members where hid = @Hid" + (system != null ? " and system = @System" : ""),
|
||||
new { Hid = hid.ToLower(), System = system }
|
||||
);
|
||||
|
||||
public Task<PKMember?> GetMemberByName(IPKConnection conn, SystemId system, string name) =>
|
||||
conn.QueryFirstOrDefaultAsync<PKMember?>("select * from members where lower(name) = lower(@Name) and system = @SystemID", new { Name = name, SystemID = system });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue