From d07d070364075107473c67244eef32da3d578777 Mon Sep 17 00:00:00 2001 From: Timothy Miller Date: Mon, 28 Oct 2024 16:36:38 +0900 Subject: [PATCH 1/2] Add Parent to ThreadView --- src/FishyFlip/Models/ThreadView.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/FishyFlip/Models/ThreadView.cs b/src/FishyFlip/Models/ThreadView.cs index 0f51be4b..5b5710ea 100644 --- a/src/FishyFlip/Models/ThreadView.cs +++ b/src/FishyFlip/Models/ThreadView.cs @@ -12,17 +12,24 @@ public class ThreadView : ATRecord /// /// Initializes a new instance of the class. /// + /// The parent of the post. /// The main post of the thread. /// The replies to the main post. /// The type of the thread. [JsonConstructor] - public ThreadView(PostView? post, ThreadView[] replies, string type) + public ThreadView(ThreadView? parent, PostView? post, ThreadView[] replies, string type) { + this.Parent = parent; this.Post = post; this.Replies = replies; this.Type = type; } + /// + /// Gets the parent of the thread. + /// + public ThreadView? Parent { get; } + /// /// Gets the main post of the thread. /// From 133f7c9de2db954eca8c715cd0dffcb28465ea73 Mon Sep 17 00:00:00 2001 From: Timothy Miller Date: Mon, 28 Oct 2024 17:00:32 +0900 Subject: [PATCH 2/2] Add PostViewer --- src/FishyFlip/Models/PostView.cs | 3 ++- src/FishyFlip/Models/PostViewer.cs | 16 ++++++++++++++++ src/FishyFlip/SourceGenerationContext.cs | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/FishyFlip/Models/PostViewer.cs diff --git a/src/FishyFlip/Models/PostView.cs b/src/FishyFlip/Models/PostView.cs index a41f70e0..23da6d0c 100644 --- a/src/FishyFlip/Models/PostView.cs +++ b/src/FishyFlip/Models/PostView.cs @@ -17,4 +17,5 @@ public record PostView( FeedProfile Author, Post? Record, DateTime IndexedAt, - IReadOnlyList