2020-06-12 21:13:21 +00:00
|
|
|
|
#nullable enable
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace PluralKit.Core
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Model for the `proxy_members` PL/pgSQL function in `functions.sql`
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class ProxyMember
|
|
|
|
|
{
|
2020-06-12 22:42:25 +00:00
|
|
|
|
public int Id { get; }
|
|
|
|
|
public IReadOnlyCollection<ProxyTag> ProxyTags { get; } = new ProxyTag[0];
|
|
|
|
|
public bool KeepProxy { get; }
|
2020-06-12 21:24:36 +00:00
|
|
|
|
|
2020-06-12 22:42:25 +00:00
|
|
|
|
public string? ServerName { get; }
|
|
|
|
|
public string? DisplayName { get; }
|
|
|
|
|
public string Name { get; } = "";
|
2020-06-12 21:24:36 +00:00
|
|
|
|
|
2020-06-12 22:42:25 +00:00
|
|
|
|
public string? ServerAvatar { get; }
|
|
|
|
|
public string? Avatar { get; }
|
2020-06-12 21:24:36 +00:00
|
|
|
|
|
2020-06-12 21:30:10 +00:00
|
|
|
|
public string ProxyName(MessageContext ctx) => ctx.SystemTag != null
|
|
|
|
|
? $"{ServerName ?? DisplayName ?? Name} {ctx.SystemTag}"
|
2020-06-12 21:24:36 +00:00
|
|
|
|
: ServerName ?? DisplayName ?? Name;
|
|
|
|
|
|
2020-06-12 21:30:10 +00:00
|
|
|
|
public string? ProxyAvatar(MessageContext ctx) => ServerAvatar ?? Avatar ?? ctx.SystemAvatar;
|
2020-06-12 21:13:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|