add pinned comment to users setter in comment bundle

This commit is contained in:
Gagah Pangeran Rosfatiputra
2021-08-13 19:22:46 +07:00
parent e3f91413cf
commit 480d5ffa5d

View File

@ -4,6 +4,7 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using osu.Game.Users; using osu.Game.Users;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace osu.Game.Online.API.Requests.Responses namespace osu.Game.Online.API.Requests.Responses
{ {
@ -52,26 +53,17 @@ namespace osu.Game.Online.API.Requests.Responses
{ {
users = value; users = value;
value.ForEach(u => foreach (var user in value)
{ {
Comments.ForEach(c => foreach (var comment in Comments.Concat(IncludedComments).Concat(PinnedComments))
{ {
if (c.UserId == u.Id) if (comment.UserId == user.Id)
c.User = u; comment.User = user;
if (c.EditedById == u.Id) if (comment.EditedById == user.Id)
c.EditedUser = u; comment.EditedUser = user;
}); }
}
IncludedComments.ForEach(c =>
{
if (c.UserId == u.Id)
c.User = u;
if (c.EditedById == u.Id)
c.EditedUser = u;
});
});
} }
} }