diff --git a/Foxnouns.Backend/Services/MemberRendererService.cs b/Foxnouns.Backend/Services/MemberRendererService.cs index ef7b923..625e8b8 100644 --- a/Foxnouns.Backend/Services/MemberRendererService.cs +++ b/Foxnouns.Backend/Services/MemberRendererService.cs @@ -29,15 +29,15 @@ public class MemberRendererService(DatabaseContext db, Config config) var renderUnlisted = token?.UserId == member.UserId && token.HasScope("user.read_hidden"); return new MemberResponse( - member.Id, member.Name, member.DisplayName, member.Bio, + member.Id, member.Sid, member.Name, member.DisplayName, member.Bio, AvatarUrlFor(member), member.Links, member.Names, member.Pronouns, member.Fields, RenderPartialUser(member.User), renderUnlisted ? member.Unlisted : null); } private UserRendererService.PartialUser RenderPartialUser(User user) => - new(user.Id, user.Username, user.DisplayName, AvatarUrlFor(user), user.CustomPreferences); + new(user.Id, user.Sid, user.Username, user.DisplayName, AvatarUrlFor(user), user.CustomPreferences); - public PartialMember RenderPartialMember(Member member, bool renderUnlisted = false) => new(member.Id, member.Name, + public PartialMember RenderPartialMember(Member member, bool renderUnlisted = false) => new(member.Id, member.Sid, member.Name, member.DisplayName, member.Bio, AvatarUrlFor(member), member.Names, member.Pronouns, renderUnlisted ? member.Unlisted : null); @@ -49,6 +49,7 @@ public class MemberRendererService(DatabaseContext db, Config config) public record PartialMember( Snowflake Id, + string Sid, string Name, string? DisplayName, string? Bio, @@ -60,6 +61,7 @@ public class MemberRendererService(DatabaseContext db, Config config) public record MemberResponse( Snowflake Id, + string Sid, string Name, string? DisplayName, string? Bio, diff --git a/Foxnouns.Backend/Services/UserRendererService.cs b/Foxnouns.Backend/Services/UserRendererService.cs index dd266fa..5a62a1a 100644 --- a/Foxnouns.Backend/Services/UserRendererService.cs +++ b/Foxnouns.Backend/Services/UserRendererService.cs @@ -37,7 +37,7 @@ public class UserRendererService(DatabaseContext db, MemberRendererService membe : []; return new UserResponse( - user.Id, user.Username, user.DisplayName, user.Bio, user.MemberTitle, AvatarUrlFor(user), user.Links, + user.Id, user.Sid, user.Username, user.DisplayName, user.Bio, user.MemberTitle, AvatarUrlFor(user), user.Links, user.Names, user.Pronouns, user.Fields, user.CustomPreferences, renderMembers ? members.Select(m => memberRenderer.RenderPartialMember(m, tokenHidden)) : null, renderAuthMethods @@ -52,13 +52,14 @@ public class UserRendererService(DatabaseContext db, MemberRendererService membe } public PartialUser RenderPartialUser(User user) => - new(user.Id, user.Username, user.DisplayName, AvatarUrlFor(user), user.CustomPreferences); + new(user.Id, user.Sid, user.Username, user.DisplayName, AvatarUrlFor(user), user.CustomPreferences); private string? AvatarUrlFor(User user) => user.Avatar != null ? $"{config.MediaBaseUrl}/users/{user.Id}/avatars/{user.Avatar}.webp" : null; public record UserResponse( Snowflake Id, + string Sid, string Username, string? DisplayName, string? Bio, @@ -92,6 +93,7 @@ public class UserRendererService(DatabaseContext db, MemberRendererService membe public record PartialUser( Snowflake Id, + string Sid, string Username, string? DisplayName, string? AvatarUrl,