mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Parse voted comments
This commit is contained in:
@ -72,6 +72,8 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
|
||||
public bool HasMessage => !string.IsNullOrEmpty(MessageHtml);
|
||||
|
||||
public bool IsVoted { get; set; }
|
||||
|
||||
public string GetMessage => HasMessage ? WebUtility.HtmlDecode(Regex.Replace(MessageHtml, @"<(.|\n)*?>", string.Empty)) : string.Empty;
|
||||
|
||||
public int DeletedChildrenCount => ChildComments.Count(c => c.IsDeleted);
|
||||
|
@ -47,6 +47,26 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty(@"included_comments")]
|
||||
public List<Comment> IncludedComments { get; set; }
|
||||
|
||||
private List<long> userVotes;
|
||||
|
||||
[JsonProperty(@"user_votes")]
|
||||
public List<long> UserVotes
|
||||
{
|
||||
get => userVotes;
|
||||
set
|
||||
{
|
||||
userVotes = value;
|
||||
value.ForEach(v =>
|
||||
{
|
||||
Comments.ForEach(c =>
|
||||
{
|
||||
if (v == c.Id)
|
||||
c.IsVoted = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private List<User> users;
|
||||
|
||||
[JsonProperty(@"users")]
|
||||
|
Reference in New Issue
Block a user