[backend/masto-client] Improve account/status url/uri field compatibility
This commit is contained in:
parent
24fd34755a
commit
004d89e78a
4 changed files with 4 additions and 2 deletions
|
@ -115,7 +115,7 @@ public class NoteRenderer(
|
|||
{
|
||||
Id = note.Id,
|
||||
Uri = uri,
|
||||
Url = note.Url ?? uri,
|
||||
Url = note.Url,
|
||||
Account = account,
|
||||
ReplyId = note.ReplyId,
|
||||
ReplyUserId = note.MastoReplyUserId ?? note.ReplyUserId,
|
||||
|
|
|
@ -55,6 +55,7 @@ public class UserRenderer(IOptions<Config.InstanceSection> config, MfmConverter
|
|||
StatusesCount = user.NotesCount,
|
||||
Note = await mfmConverter.ToHtmlAsync(profile?.Description ?? "", mentions, user.Host),
|
||||
Url = profile?.Url ?? user.Uri ?? user.GetPublicUrl(config.Value),
|
||||
Uri = user.Uri ?? user.GetPublicUri(config.Value),
|
||||
AvatarStaticUrl = user.AvatarUrl ?? user.GetIdenticonUrlPng(config.Value), //TODO
|
||||
HeaderUrl = user.BannerUrl ?? _transparent,
|
||||
HeaderStaticUrl = user.BannerUrl ?? _transparent, //TODO
|
||||
|
|
|
@ -16,6 +16,7 @@ public class AccountEntity : IEntity
|
|||
[J("statuses_count")] public required long StatusesCount { get; set; }
|
||||
[J("note")] public required string Note { get; set; }
|
||||
[J("url")] public required string Url { get; set; }
|
||||
[J("url")] public required string Uri { get; set; }
|
||||
[J("avatar")] public required string AvatarUrl { get; set; }
|
||||
[J("avatar_static")] public required string AvatarStaticUrl { get; set; }
|
||||
[J("header")] public required string HeaderUrl { get; set; }
|
||||
|
|
|
@ -13,7 +13,7 @@ public class StatusEntity : IEntity, ICloneable
|
|||
[J("text")] public required string? Text { get; set; }
|
||||
[J("content")] public required string? Content { get; set; }
|
||||
[J("uri")] public required string Uri { get; set; }
|
||||
[J("url")] public required string Url { get; set; }
|
||||
[J("url")] public required string? Url { get; set; }
|
||||
[J("account")] public required AccountEntity Account { get; set; }
|
||||
[J("in_reply_to_id")] public required string? ReplyId { get; set; }
|
||||
[J("in_reply_to_account_id")] public required string? ReplyUserId { get; set; }
|
||||
|
|
Loading…
Add table
Reference in a new issue