1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 13:32:54 +08:00

Handle edited comments

This commit is contained in:
Andrei Zavatski 2019-10-09 11:32:17 +03:00
parent a0dfbfe148
commit ad99a3236f
3 changed files with 18 additions and 1 deletions

View File

@ -63,6 +63,9 @@ namespace osu.Game.Online.API.Requests.Responses
{
if (c.UserId == u.Id)
c.User = u;
if (c.EditedById == u.Id)
c.EditedUser = u;
});
});
}

View File

@ -81,6 +81,8 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"edited_by_id")]
public long? EditedById { get; set; }
public User EditedUser { get; set; }
public bool IsTopLevel { get; set; }
public bool IsDeleted { get; set; }

View File

@ -35,6 +35,7 @@ namespace osu.Game.Overlays.Comments
{
LinkFlowContainer username;
FillFlowContainer childCommentsContainer;
FillFlowContainer info;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
@ -140,7 +141,7 @@ namespace osu.Game.Overlays.Comments
{
RelativeSizeAxes = Axes.Both,
},
new FillFlowContainer
info = new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
@ -188,6 +189,17 @@ namespace osu.Game.Overlays.Comments
username.AddUserLink(comment.User);
}
if (comment.EditedAt.HasValue)
{
info.Add(new SpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Font = OsuFont.GetFont(size: 12),
Text = $@"edited {HumanizerUtils.Humanize(comment.EditedAt.Value)} by {comment.EditedUser.Username}"
});
}
comment.ChildComments.ForEach(c =>
{
if (!c.IsDeleted)