PluralKit/PluralKit.Core/Models/PKSystem.cs

36 lines
1.2 KiB
C#
Raw Normal View History

using Dapper.Contrib.Extensions;
using Newtonsoft.Json;
using NodaTime;
namespace PluralKit.Core {
public class PKSystem
{
// Additions here should be mirrored in SystemStore::Save
2020-06-14 19:37:04 +00:00
[Key] public SystemId Id { get; }
2020-06-13 11:11:08 +00:00
public string Hid { get; }
public string Name { get; }
public string Description { get; }
public string Tag { get; }
public string AvatarUrl { get; }
public string Token { get; }
2020-06-13 11:11:08 +00:00
public Instant Created { get; }
2020-06-13 11:06:41 +00:00
public string UiTz { get; set; }
public bool PingsEnabled { get; }
public PrivacyLevel DescriptionPrivacy { get; }
public PrivacyLevel MemberListPrivacy { get;}
public PrivacyLevel FrontPrivacy { get; }
public PrivacyLevel FrontHistoryPrivacy { get; }
public PrivacyLevel GroupListPrivacy { get; }
[JsonIgnore] public DateTimeZone Zone => DateTimeZoneProviders.Tzdb.GetZoneOrNull(UiTz);
}
public static class PKSystemExt
{
public static string DescriptionFor(this PKSystem system, LookupContext ctx) =>
system.DescriptionPrivacy.Get(ctx, system.Description);
}
2020-03-21 13:04:41 +00:00
}