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
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
public IReadOnlyCollection<ProxyTag> ProxyTags { get; set; } = new ProxyTag[0];
|
|
|
|
|
public bool KeepProxy { get; set; }
|
2020-06-12 21:24:36 +00:00
|
|
|
|
|
|
|
|
|
public string? ServerName { get; set; }
|
|
|
|
|
public string? DisplayName { get; set; }
|
|
|
|
|
public string Name { get; set; } = "";
|
|
|
|
|
|
|
|
|
|
public string? ServerAvatar { get; set; }
|
|
|
|
|
public string? Avatar { get; set; }
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|