1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:17:23 +08:00

Apply NRT to Comment

This commit is contained in:
ansel 2022-09-27 22:45:05 +03:00
parent 4013c96ca5
commit 58d9509ce6
2 changed files with 8 additions and 10 deletions

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using Newtonsoft.Json;
using System;
@ -16,18 +14,18 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"parent_id")]
public long? ParentId { get; set; }
public Comment ParentComment { get; set; }
public Comment? ParentComment { get; set; }
[JsonProperty(@"user_id")]
public long? UserId { get; set; }
public APIUser User { get; set; }
public APIUser? User { get; set; }
[JsonProperty(@"message")]
public string Message { get; set; }
public string Message { get; set; } = null!;
[JsonProperty(@"message_html")]
public string MessageHtml { get; set; }
public string? MessageHtml { get; set; }
[JsonProperty(@"replies_count")]
public int RepliesCount { get; set; }
@ -36,13 +34,13 @@ namespace osu.Game.Online.API.Requests.Responses
public int VotesCount { get; set; }
[JsonProperty(@"commenatble_type")]
public string CommentableType { get; set; }
public string CommentableType { get; set; } = null!;
[JsonProperty(@"commentable_id")]
public int CommentableId { get; set; }
[JsonProperty(@"legacy_name")]
public string LegacyName { get; set; }
public string? LegacyName { get; set; }
[JsonProperty(@"created_at")]
public DateTimeOffset CreatedAt { get; set; }
@ -62,7 +60,7 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"pinned")]
public bool Pinned { get; set; }
public APIUser EditedUser { get; set; }
public APIUser? EditedUser { get; set; }
public bool IsTopLevel => !ParentId.HasValue;

View File

@ -266,7 +266,7 @@ namespace osu.Game.Overlays.Comments
else
username.AddText(Comment.LegacyName);
if (Comment.EditedAt.HasValue)
if (Comment.EditedAt.HasValue && Comment.EditedUser != null)
{
var font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular);
var colour = colourProvider.Foreground1;