Move most references to PKMember.Name to go through helper extepsions for privacy
This commit is contained in:
8
PluralKit.Core/Models/ModelExtensions.cs
Normal file
8
PluralKit.Core/Models/ModelExtensions.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user