diff --git a/PluralKit.API/Controllers/MemberController.cs b/PluralKit.API/Controllers/MemberController.cs index 63cce0a0..3bf30976 100644 --- a/PluralKit.API/Controllers/MemberController.cs +++ b/PluralKit.API/Controllers/MemberController.cs @@ -41,6 +41,8 @@ namespace PluralKit.API.Controllers // Explicit bounds checks if (newMember.Name != null && newMember.Name.Length > Limits.MaxMemberNameLength) return BadRequest($"Member name too long ({newMember.Name.Length} > {Limits.MaxMemberNameLength}."); + if (newMember.DisplayName != null && newMember.DisplayName.Length > Limits.MaxMemberNameLength) + return BadRequest($"Member display name too long ({newMember.DisplayName.Length} > {Limits.MaxMemberNameLength}."); if (newMember.Pronouns != null && newMember.Pronouns.Length > Limits.MaxPronounsLength) return BadRequest($"Member pronouns too long ({newMember.Pronouns.Length} > {Limits.MaxPronounsLength}."); if (newMember.Description != null && newMember.Description.Length > Limits.MaxDescriptionLength) @@ -57,6 +59,7 @@ namespace PluralKit.API.Controllers var member = await _members.Create(system, newMember.Name); member.Name = newMember.Name; + member.DisplayName = newMember.DisplayName; member.Color = newMember.Color; member.AvatarUrl = newMember.AvatarUrl; member.Birthday = newMember.Birthday; @@ -84,6 +87,8 @@ namespace PluralKit.API.Controllers // Explicit bounds checks if (newMember.Name != null && newMember.Name.Length > Limits.MaxMemberNameLength) return BadRequest($"Member name too long ({newMember.Name.Length} > {Limits.MaxMemberNameLength}."); + if (newMember.DisplayName != null && newMember.DisplayName.Length > Limits.MaxMemberNameLength) + return BadRequest($"Member display name too long ({newMember.DisplayName.Length} > {Limits.MaxMemberNameLength}."); if (newMember.Pronouns != null && newMember.Pronouns.Length > Limits.MaxPronounsLength) return BadRequest($"Member pronouns too long ({newMember.Pronouns.Length} > {Limits.MaxPronounsLength}."); if (newMember.Description != null && newMember.Description.Length > Limits.MaxDescriptionLength) @@ -98,6 +103,7 @@ namespace PluralKit.API.Controllers return BadRequest(); member.Name = newMember.Name; + member.DisplayName = newMember.DisplayName; member.Color = newMember.Color; member.AvatarUrl = newMember.AvatarUrl; member.Birthday = newMember.Birthday;