mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat: refactor external input handling code
- refactor import/export code - make import/export use the same JSON parsing as API - make Patch.AssertIsValid actually useful
This commit is contained in:
parent
f912805ecc
commit
4b944e2b20
18 changed files with 619 additions and 694 deletions
|
|
@ -102,7 +102,7 @@ namespace PluralKit.Core {
|
|||
public static int MessageCountFor(this PKMember member, LookupContext ctx) =>
|
||||
member.MetadataPrivacy.Get(ctx, member.MessageCount);
|
||||
|
||||
public static JObject ToJson(this PKMember member, LookupContext ctx)
|
||||
public static JObject ToJson(this PKMember member, LookupContext ctx, bool needsLegacyProxyTags = false)
|
||||
{
|
||||
var includePrivacy = ctx == LookupContext.ByOwner;
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ namespace PluralKit.Core {
|
|||
|
||||
o.Add("created", member.CreatedFor(ctx)?.FormatExport());
|
||||
|
||||
if (member.ProxyTags.Count > 0)
|
||||
if (member.ProxyTags.Count > 0 && needsLegacyProxyTags)
|
||||
{
|
||||
// Legacy compatibility only, TODO: remove at some point
|
||||
o.Add("prefix", member.ProxyTags?.FirstOrDefault().Prefix);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue