Move system tag/icon from ProxyMember to MessageContent
This commit is contained in:
@@ -23,5 +23,7 @@ namespace PluralKit.Core
|
||||
public int LastSwitch { get; set; }
|
||||
public IReadOnlyList<int> LastSwitchMembers { get; set; } = new int[0];
|
||||
public Instant LastSwitchTimestamp { get; set; }
|
||||
public string? SystemTag { get; set; }
|
||||
public string? SystemAvatar { get; set; }
|
||||
}
|
||||
}
|
@@ -15,16 +15,14 @@ namespace PluralKit.Core
|
||||
public string? ServerName { get; set; }
|
||||
public string? DisplayName { get; set; }
|
||||
public string Name { get; set; } = "";
|
||||
public string? SystemTag { get; set; }
|
||||
|
||||
public string? ServerAvatar { get; set; }
|
||||
public string? Avatar { get; set; }
|
||||
public string? SystemIcon { get; set; }
|
||||
|
||||
public string ProxyName => SystemTag != null
|
||||
? $"{ServerName ?? DisplayName ?? Name} {SystemTag}"
|
||||
public string ProxyName(MessageContext ctx) => ctx.SystemTag != null
|
||||
? $"{ServerName ?? DisplayName ?? Name} {ctx.SystemTag}"
|
||||
: ServerName ?? DisplayName ?? Name;
|
||||
|
||||
public string? ProxyAvatar => ServerAvatar ?? Avatar ?? SystemIcon;
|
||||
public string? ProxyAvatar(MessageContext ctx) => ServerAvatar ?? Avatar ?? ctx.SystemAvatar;
|
||||
}
|
||||
}
|
@@ -12,7 +12,9 @@
|
||||
last_message_member int,
|
||||
last_switch int,
|
||||
last_switch_members int[],
|
||||
last_switch_timestamp timestamp
|
||||
last_switch_timestamp timestamp,
|
||||
system_tag text,
|
||||
system_avatar text
|
||||
)
|
||||
as $$
|
||||
with
|
||||
@@ -32,7 +34,9 @@ as $$
|
||||
last_message.member as last_message_member,
|
||||
system_last_switch.switch as last_switch,
|
||||
system_last_switch.members as last_switch_members,
|
||||
system_last_switch.timestamp as last_switch_timestamp
|
||||
system_last_switch.timestamp as last_switch_timestamp,
|
||||
system.tag as system_tag,
|
||||
system.avatar_url as system_avatar
|
||||
from system
|
||||
full join guild on true
|
||||
left join last_message on true
|
||||
@@ -53,11 +57,9 @@ create function proxy_members(account_id bigint, guild_id bigint)
|
||||
server_name text,
|
||||
display_name text,
|
||||
name text,
|
||||
system_tag text,
|
||||
|
||||
server_avatar text,
|
||||
avatar text,
|
||||
system_icon text
|
||||
avatar text
|
||||
)
|
||||
as $$
|
||||
select
|
||||
@@ -70,12 +72,10 @@ as $$
|
||||
member_guild.display_name as server_name,
|
||||
members.display_name as display_name,
|
||||
members.name as name,
|
||||
systems.tag as system_tag,
|
||||
|
||||
-- Avatar info
|
||||
member_guild.avatar_url as server_avatar,
|
||||
members.avatar_url as avatar,
|
||||
systems.avatar_url as system_icon
|
||||
members.avatar_url as avatar
|
||||
from accounts
|
||||
inner join systems on systems.id = accounts.system
|
||||
inner join members on members.system = systems.id
|
||||
|
Reference in New Issue
Block a user