Add support for deleted comments with message

This commit is contained in:
Andrei Zavatski
2019-10-15 12:07:01 +03:00
parent 213f00556d
commit 96e31b9cca
2 changed files with 18 additions and 13 deletions

View File

@ -70,13 +70,9 @@ namespace osu.Game.Online.API.Requests.Responses
public bool IsDeleted => DeletedAt.HasValue;
public string GetMessage()
{
if (IsDeleted)
return @"deleted";
public bool HasMessage => !string.IsNullOrEmpty(MessageHtml);
return WebUtility.HtmlDecode(Regex.Replace(MessageHtml, @"<(.|\n)*?>", string.Empty));
}
public string GetMessage => HasMessage ? WebUtility.HtmlDecode(Regex.Replace(MessageHtml, @"<(.|\n)*?>", string.Empty)) : string.Empty;
public int DeletedChildrenCount => ChildComments.Count(c => c.IsDeleted);
}