Move most references to PKMember.Name to go through helper extepsions for privacy
This commit is contained in:
@@ -20,5 +20,7 @@
|
||||
public static bool operator !=(MemberId left, MemberId right) => !left.Equals(right);
|
||||
|
||||
public int CompareTo(MemberId other) => Value.CompareTo(other.Value);
|
||||
|
||||
public override string ToString() => $"Member #{Value}";
|
||||
}
|
||||
}
|
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;
|
||||
}
|
||||
}
|
@@ -20,5 +20,7 @@
|
||||
public static bool operator !=(SwitchId left, SwitchId right) => !left.Equals(right);
|
||||
|
||||
public int CompareTo(SwitchId other) => Value.CompareTo(other.Value);
|
||||
|
||||
public override string ToString() => $"Switch #{Value}";
|
||||
}
|
||||
}
|
@@ -20,5 +20,7 @@
|
||||
public static bool operator !=(SystemId left, SystemId right) => !left.Equals(right);
|
||||
|
||||
public int CompareTo(SystemId other) => Value.CompareTo(other.Value);
|
||||
|
||||
public override string ToString() => $"System #{Value}";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user