From e3a41c619012930e29e729d9794847c10c4fd261 Mon Sep 17 00:00:00 2001 From: Kopper Date: Sun, 1 Sep 2024 00:44:26 +0300 Subject: [PATCH] [backend/akko-client] Expose required pleroma.emoji_reactions field --- .../Controllers/Mastodon/Renderers/NoteRenderer.cs | 6 +++++- .../Mastodon/Schemas/Entities/StatusEntity.cs | 3 +++ .../Controllers/Pleroma/Schemas/Entities/StatusEntity.cs | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 Iceshrimp.Backend/Controllers/Pleroma/Schemas/Entities/StatusEntity.cs diff --git a/Iceshrimp.Backend/Controllers/Mastodon/Renderers/NoteRenderer.cs b/Iceshrimp.Backend/Controllers/Mastodon/Renderers/NoteRenderer.cs index 726f80ac..d4bb2122 100644 --- a/Iceshrimp.Backend/Controllers/Mastodon/Renderers/NoteRenderer.cs +++ b/Iceshrimp.Backend/Controllers/Mastodon/Renderers/NoteRenderer.cs @@ -161,7 +161,11 @@ public class NoteRenderer( Emojis = noteEmoji, Poll = poll, Reactions = reactions, - Filtered = filterResult + Filtered = filterResult, + + Pleroma = new() { + Reactions = reactions + } }; return res; diff --git a/Iceshrimp.Backend/Controllers/Mastodon/Schemas/Entities/StatusEntity.cs b/Iceshrimp.Backend/Controllers/Mastodon/Schemas/Entities/StatusEntity.cs index d495111d..2d5a653a 100644 --- a/Iceshrimp.Backend/Controllers/Mastodon/Schemas/Entities/StatusEntity.cs +++ b/Iceshrimp.Backend/Controllers/Mastodon/Schemas/Entities/StatusEntity.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; +using Iceshrimp.Backend.Controllers.Pleroma.Schemas.Entities; using Iceshrimp.Backend.Core.Database; using Iceshrimp.Backend.Core.Database.Tables; using Iceshrimp.Backend.Core.Middleware; @@ -55,6 +56,8 @@ public class StatusEntity : IEntity, ICloneable public object Clone() => MemberwiseClone(); [J("id")] public required string Id { get; set; } + [J("pleroma")] public required PleromaStatusExtensions Pleroma { get; set; } + public static string EncodeVisibility(Note.NoteVisibility visibility) { return visibility switch diff --git a/Iceshrimp.Backend/Controllers/Pleroma/Schemas/Entities/StatusEntity.cs b/Iceshrimp.Backend/Controllers/Pleroma/Schemas/Entities/StatusEntity.cs new file mode 100644 index 00000000..6a7affb0 --- /dev/null +++ b/Iceshrimp.Backend/Controllers/Pleroma/Schemas/Entities/StatusEntity.cs @@ -0,0 +1,9 @@ +using Iceshrimp.Backend.Controllers.Mastodon.Schemas.Entities; +using J = System.Text.Json.Serialization.JsonPropertyNameAttribute; + +namespace Iceshrimp.Backend.Controllers.Pleroma.Schemas.Entities; + +public class PleromaStatusExtensions +{ + [J("emoji_reactions")] public required List Reactions { get; set; } +} \ No newline at end of file