Move most references to PKMember.Name to go through helper extepsions for privacy

This commit is contained in:
Ske
2020-06-18 17:08:36 +02:00
parent 761270f0c3
commit 56eae82b0a
22 changed files with 97 additions and 62 deletions

View File

@@ -22,11 +22,10 @@ namespace PluralKit.Bot
var proxyTagsString = m.ProxyTagsString().SanitizeMentions();
if (proxyTagsString.Length > 100) // arbitrary threshold for now, tweak?
proxyTagsString = "tags too long, see member card";
var memberName = m.NamePrivacy.CanAccess(ctx) ? m.Name : (m.DisplayName ?? m.Name);
return $"[`{m.Hid}`] **{memberName.SanitizeMentions()}** *({proxyTagsString})*";
return $"[`{m.Hid}`] **{m.NameFor(ctx).SanitizeMentions()}** *({proxyTagsString})*";
}
return $"[`{m.Hid}`] **{m.Name.SanitizeMentions()}**";
return $"[`{m.Hid}`] **{m.NameFor(ctx).SanitizeMentions()}**";
}
var buf = new StringBuilder();