PluralKit/PluralKit.Core/Models/ModelExtensions.cs

11 lines
421 B
C#
Raw Normal View History

namespace PluralKit.Core
{
public static class ModelExtensions
{
public static string NameFor(this PKMember member, LookupContext ctx) =>
member.NamePrivacy.CanAccess(ctx) ? member.Name : member.DisplayName ?? member.Name;
2020-06-20 14:00:50 +00:00
public static string AvatarFor(this PKMember member, LookupContext ctx) =>
member.AvatarPrivacy.CanAccess(ctx) ? member.AvatarUrl : null;
}
}