From 2c7490a30445330cf67635b89d4582545ab3f903 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Wed, 15 May 2024 13:11:17 +0200 Subject: [PATCH] [backend/masto-client] Always send text property on status entities (ISH-323) --- .../Controllers/Mastodon/Renderers/NoteRenderer.cs | 2 +- .../Mastodon/Schemas/Entities/StatusEntity.cs | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Iceshrimp.Backend/Controllers/Mastodon/Renderers/NoteRenderer.cs b/Iceshrimp.Backend/Controllers/Mastodon/Renderers/NoteRenderer.cs index e0141323..d5efc955 100644 --- a/Iceshrimp.Backend/Controllers/Mastodon/Renderers/NoteRenderer.cs +++ b/Iceshrimp.Backend/Controllers/Mastodon/Renderers/NoteRenderer.cs @@ -125,7 +125,7 @@ public class NoteRenderer( ContentWarning = note.Cw ?? "", Visibility = StatusEntity.EncodeVisibility(note.Visibility), Content = content, - Text = data?.Source == true ? text : null, + Text = text, Mentions = mentions, IsPinned = pinned, Attachments = attachments, diff --git a/Iceshrimp.Backend/Controllers/Mastodon/Schemas/Entities/StatusEntity.cs b/Iceshrimp.Backend/Controllers/Mastodon/Schemas/Entities/StatusEntity.cs index 26ad91fd..e9fcb018 100644 --- a/Iceshrimp.Backend/Controllers/Mastodon/Schemas/Entities/StatusEntity.cs +++ b/Iceshrimp.Backend/Controllers/Mastodon/Schemas/Entities/StatusEntity.cs @@ -9,6 +9,8 @@ namespace Iceshrimp.Backend.Controllers.Mastodon.Schemas.Entities; public class StatusEntity : IEntity, ICloneable { + [J("id")] public required string Id { get; set; } + [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; } @@ -32,10 +34,6 @@ public class StatusEntity : IEntity, ICloneable [J("spoiler_text")] public required string ContentWarning { get; set; } [J("visibility")] public required string Visibility { get; set; } - [J("text")] - [JI(Condition = JsonIgnoreCondition.WhenWritingNull)] - public required string? Text { get; set; } - [J("pinned")] [JI(Condition = JsonIgnoreCondition.WhenWritingNull)] public required bool? IsPinned { get; set; } @@ -52,8 +50,7 @@ public class StatusEntity : IEntity, ICloneable [J("card")] public object? Card => null; //FIXME [J("application")] public object? Application => null; //FIXME - [J("language")] public string? Language => null; //FIXME - [J("id")] public required string Id { get; set; } + [J("language")] public string? Language => null; //FIXME [JI] public string? MastoReplyUserId;