Add disabling front/latch autoproxy per-member
This commit is contained in:
@@ -19,7 +19,7 @@ namespace PluralKit.Core
|
||||
internal class Database: IDatabase
|
||||
{
|
||||
private const string RootPath = "PluralKit.Core.Database"; // "resource path" root for SQL files
|
||||
private const int TargetSchemaVersion = 11;
|
||||
private const int TargetSchemaVersion = 12;
|
||||
|
||||
private readonly CoreConfig _config;
|
||||
private readonly ILogger _logger;
|
||||
|
@@ -19,6 +19,8 @@ namespace PluralKit.Core
|
||||
public string? ServerAvatar { get; }
|
||||
public string? Avatar { get; }
|
||||
|
||||
public bool AllowAutoproxy { get; }
|
||||
|
||||
public string ProxyName(MessageContext ctx) => ctx.SystemTag != null
|
||||
? $"{ServerName ?? DisplayName ?? Name} {ctx.SystemTag}"
|
||||
: ServerName ?? DisplayName ?? Name;
|
||||
|
@@ -62,7 +62,9 @@ create function proxy_members(account_id bigint, guild_id bigint)
|
||||
name text,
|
||||
|
||||
server_avatar text,
|
||||
avatar text
|
||||
avatar text,
|
||||
|
||||
allow_autoproxy bool
|
||||
)
|
||||
as $$
|
||||
select
|
||||
@@ -78,7 +80,9 @@ as $$
|
||||
|
||||
-- Avatar info
|
||||
member_guild.avatar_url as server_avatar,
|
||||
members.avatar_url as avatar
|
||||
members.avatar_url as avatar,
|
||||
|
||||
members.allow_autoproxy as allow_autoproxy
|
||||
from accounts
|
||||
inner join systems on systems.id = accounts.system
|
||||
inner join members on members.system = systems.id
|
||||
|
5
PluralKit.Core/Database/Migrations/12.sql
Normal file
5
PluralKit.Core/Database/Migrations/12.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
-- SCHEMA VERSION 12: <insert date> --
|
||||
-- Add disabling front/latch autoproxy per-member --
|
||||
|
||||
alter table members add column allow_autoproxy bool not null default true;
|
||||
update info set schema_version = 12;
|
Reference in New Issue
Block a user