From a82af47c679e61ddae4b57564e4a7c0c4ff244a1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 8 May 2024 14:53:33 -0500 Subject: [PATCH] quote_repost -> quote --- src/interfaces/DittoEvent.ts | 2 +- src/storages/hydrate.test.ts | 4 ++-- src/storages/hydrate.ts | 2 +- src/views/mastodon/statuses.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/interfaces/DittoEvent.ts b/src/interfaces/DittoEvent.ts index 32c6e93..41847fb 100644 --- a/src/interfaces/DittoEvent.ts +++ b/src/interfaces/DittoEvent.ts @@ -23,7 +23,7 @@ export interface DittoEvent extends NostrEvent { d_author?: DittoEvent; user?: DittoEvent; repost?: DittoEvent; - quote_repost?: DittoEvent; + quote?: DittoEvent; reacted?: DittoEvent; /** The profile being reported. * Must be a kind 0 hydrated. diff --git a/src/storages/hydrate.test.ts b/src/storages/hydrate.test.ts index c0c0a42..10e480e 100644 --- a/src/storages/hydrate.test.ts +++ b/src/storages/hydrate.test.ts @@ -96,7 +96,7 @@ Deno.test('hydrateEvents(): quote repost --- WITHOUT stats', async () => { const expectedEvent1quoteRepost = { ...event1quoteRepostCopy, author: event0madeQuoteRepostCopy, - quote_repost: { ...event1willBeQuoteRepostedCopy, author: event0copy }, + quote: { ...event1willBeQuoteRepostedCopy, author: event0copy }, }; assertEquals(event1quoteRepostCopy, expectedEvent1quoteRepost); @@ -127,7 +127,7 @@ Deno.test('hydrateEvents(): repost of quote repost --- WITHOUT stats', async () const expectedEvent6 = { ...event6copy, author: event0copy, - repost: { ...event1quoteCopy, author: event0copy, quote_repost: { author: event0copy, ...event1copy } }, + repost: { ...event1quoteCopy, author: event0copy, quote: { author: event0copy, ...event1copy } }, }; assertEquals(event6copy, expectedEvent6); }); diff --git a/src/storages/hydrate.ts b/src/storages/hydrate.ts index 41670aa..e197ca8 100644 --- a/src/storages/hydrate.ts +++ b/src/storages/hydrate.ts @@ -80,7 +80,7 @@ function assembleEvents( if (event.kind === 1) { const id = event.tags.find(([name]) => name === 'q')?.[1]; if (id) { - event.quote_repost = b.find((e) => matchFilter({ kinds: [1], ids: [id] }, e)); + event.quote = b.find((e) => matchFilter({ kinds: [1], ids: [id] }, e)); } } diff --git a/src/views/mastodon/statuses.ts b/src/views/mastodon/statuses.ts index 21d380b..c743e8b 100644 --- a/src/views/mastodon/statuses.ts +++ b/src/views/mastodon/statuses.ts @@ -109,7 +109,7 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise< tags: [], emojis: renderEmojis(event), poll: null, - quote: !event.quote_repost ? null : await renderStatus(event.quote_repost, { depth: depth + 1 }), + quote: !event.quote ? null : await renderStatus(event.quote, { depth: depth + 1 }), quote_id: event.tags.find(([name]) => name === 'q')?.[1] ?? null, uri: Conf.external(note), url: Conf.external(note),