ui: add quoted reposts view to threads

This adds quote reposts as an additional detail view on threads. It will
list quoted reposts that have the `q` tag. Not all clients have updated
to this yet (like primal), but hopefully they will soon.

Changelog-Added: Show list of quoted reposts in threads
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-03-16 12:20:59 +00:00
parent 3f1f257df2
commit c521998158
7 changed files with 74 additions and 15 deletions

View File

@@ -32,6 +32,7 @@ enum Route: Hashable {
case DeveloperSettings(settings: UserSettingsStore)
case Thread(thread: ThreadModel)
case Reposts(reposts: EventsModel)
case QuoteReposts(quotes: EventsModel)
case Reactions(reactions: EventsModel)
case Zaps(target: ZapTarget)
case Search(search: SearchModel)
@@ -92,6 +93,8 @@ enum Route: Hashable {
ThreadView(state: damusState, thread: thread)
case .Reposts(let reposts):
RepostsView(damus_state: damusState, model: reposts)
case .QuoteReposts(let quote_reposts):
QuoteRepostsView(damus_state: damusState, model: quote_reposts)
case .Reactions(let reactions):
ReactionsView(damus_state: damusState, model: reactions)
case .Zaps(let target):
@@ -178,6 +181,9 @@ enum Route: Hashable {
case .Reposts(let reposts):
hasher.combine("reposts")
hasher.combine(reposts.target)
case .QuoteReposts(let evs_model):
hasher.combine("quote_reposts")
hasher.combine(evs_model.events.events.count)
case .Zaps(let target):
hasher.combine("zaps")
hasher.combine(target.id)