mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Parse child comments
This commit is contained in:
@ -9,8 +9,28 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
{
|
||||
public class APIComments
|
||||
{
|
||||
private List<Comment> comments;
|
||||
|
||||
[JsonProperty(@"comments")]
|
||||
public List<Comment> Comments { get; set; }
|
||||
public List<Comment> Comments
|
||||
{
|
||||
get => comments;
|
||||
set
|
||||
{
|
||||
comments = value;
|
||||
comments.ForEach(child =>
|
||||
{
|
||||
if (child.ParentId != null)
|
||||
{
|
||||
comments.ForEach(parent =>
|
||||
{
|
||||
if (parent.Id == child.ParentId)
|
||||
parent.ChildComments.Add(child);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty(@"has_more")]
|
||||
public bool HasMore { get; set; }
|
||||
|
@ -4,6 +4,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Online.API.Requests.Responses
|
||||
{
|
||||
@ -25,6 +26,8 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
}
|
||||
}
|
||||
|
||||
public List<Comment> ChildComments = new List<Comment>();
|
||||
|
||||
[JsonProperty(@"user_id")]
|
||||
public long UserId { get; set; }
|
||||
|
||||
|
Reference in New Issue
Block a user