fix(bot): make proxy/log blacklists work properly with threads

Handling of both blacklists was inconsistent when dealing with threads:
- proxy blacklist of root channel blacklists all threads
- log blacklist of root channel _did not apply_ to threads
- couldn't proxy blacklist threads while leaving root channel proxyable

This change fixes the inconsistencies:
- proxy _and_ log blacklist of root channel affects all threads
- now able to individually proxy/log blacklist threads, with root
  channel unaffected
This commit is contained in:
Iris System
2023-05-10 13:16:16 +12:00
parent 24f0fcd563
commit 66544b9d40
7 changed files with 34 additions and 26 deletions

View File

@@ -2,9 +2,9 @@ namespace PluralKit.Core;
public partial class ModelRepository
{
public Task<MessageContext> GetMessageContext(ulong account, ulong guild, ulong channel)
public Task<MessageContext> GetMessageContext(ulong account, ulong guild, ulong channel, ulong thread)
=> _db.QuerySingleProcedure<MessageContext>("message_context",
new { account_id = account, guild_id = guild, channel_id = channel });
new { account_id = account, guild_id = guild, channel_id = channel, thread_id = thread });
public Task<IEnumerable<ProxyMember>> GetProxyMembers(ulong account, ulong guild)
=> _db.QueryProcedure<ProxyMember>("proxy_members", new { account_id = account, guild_id = guild });