mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Add a User property to the comment for easy access
This commit is contained in:
@ -24,8 +24,26 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty(@"included_comments")]
|
||||
public List<Comment> IncludedComments { get; set; }
|
||||
|
||||
private List<User> users;
|
||||
|
||||
[JsonProperty(@"users")]
|
||||
public List<User> Users { get; set; }
|
||||
public List<User> Users
|
||||
{
|
||||
get => users;
|
||||
set
|
||||
{
|
||||
users = value;
|
||||
|
||||
value.ForEach(u =>
|
||||
{
|
||||
Comments.ForEach(c =>
|
||||
{
|
||||
if (c.UserId == u.Id)
|
||||
c.User = u;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty(@"total")]
|
||||
public int Total { get; set; }
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Users;
|
||||
using System;
|
||||
|
||||
namespace osu.Game.Online.API.Requests.Responses
|
||||
@ -27,6 +28,8 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty(@"user_id")]
|
||||
public long UserId { get; set; }
|
||||
|
||||
public User User { get; set; }
|
||||
|
||||
[JsonProperty(@"message")]
|
||||
public string Message { get; set; }
|
||||
|
||||
|
Reference in New Issue
Block a user