feat: proxy tag privacy (#571)

Merges PluralKit/PluralKit#571
This commit is contained in:
rladenson 2023-08-10 17:54:53 +12:00 committed by Iris System
parent 084df88624
commit 68cd21fb2f
8 changed files with 46 additions and 9 deletions

View file

@ -146,7 +146,7 @@ public static class ContextListExt
ret += $"({m.DisplayName})";
else if (opts.IncludeBirthday && m.BirthdayFor(lookupCtx) is { } birthday)
ret += $"(birthday: {m.BirthdayString})";
else if (m.HasProxyTags)
else if (m.HasProxyTags && m.ProxyPrivacy.CanAccess(lookupCtx))
{
var proxyTagsString = m.ProxyTagsString();
if (proxyTagsString.Length > 100) // arbitrary threshold for now, tweak?
@ -173,7 +173,7 @@ public static class ContextListExt
if (m.BirthdayFor(lookupCtx) != null)
profile.Append($"\n**Birthdate**: {m.BirthdayString}");
if (m.ProxyTags.Count > 0)
if (m.ProxyTags.Count > 0 && m.ProxyPrivacy.CanAccess(lookupCtx))
profile.Append($"\n**Proxy tags**: {m.ProxyTagsString()}");
if ((opts.IncludeMessageCount || opts.SortProperty == SortProperty.MessageCount) &&