quote_repost -> quote
This commit is contained in:
parent
71899e54de
commit
a82af47c67
|
@ -23,7 +23,7 @@ export interface DittoEvent extends NostrEvent {
|
||||||
d_author?: DittoEvent;
|
d_author?: DittoEvent;
|
||||||
user?: DittoEvent;
|
user?: DittoEvent;
|
||||||
repost?: DittoEvent;
|
repost?: DittoEvent;
|
||||||
quote_repost?: DittoEvent;
|
quote?: DittoEvent;
|
||||||
reacted?: DittoEvent;
|
reacted?: DittoEvent;
|
||||||
/** The profile being reported.
|
/** The profile being reported.
|
||||||
* Must be a kind 0 hydrated.
|
* Must be a kind 0 hydrated.
|
||||||
|
|
|
@ -96,7 +96,7 @@ Deno.test('hydrateEvents(): quote repost --- WITHOUT stats', async () => {
|
||||||
const expectedEvent1quoteRepost = {
|
const expectedEvent1quoteRepost = {
|
||||||
...event1quoteRepostCopy,
|
...event1quoteRepostCopy,
|
||||||
author: event0madeQuoteRepostCopy,
|
author: event0madeQuoteRepostCopy,
|
||||||
quote_repost: { ...event1willBeQuoteRepostedCopy, author: event0copy },
|
quote: { ...event1willBeQuoteRepostedCopy, author: event0copy },
|
||||||
};
|
};
|
||||||
|
|
||||||
assertEquals(event1quoteRepostCopy, expectedEvent1quoteRepost);
|
assertEquals(event1quoteRepostCopy, expectedEvent1quoteRepost);
|
||||||
|
@ -127,7 +127,7 @@ Deno.test('hydrateEvents(): repost of quote repost --- WITHOUT stats', async ()
|
||||||
const expectedEvent6 = {
|
const expectedEvent6 = {
|
||||||
...event6copy,
|
...event6copy,
|
||||||
author: event0copy,
|
author: event0copy,
|
||||||
repost: { ...event1quoteCopy, author: event0copy, quote_repost: { author: event0copy, ...event1copy } },
|
repost: { ...event1quoteCopy, author: event0copy, quote: { author: event0copy, ...event1copy } },
|
||||||
};
|
};
|
||||||
assertEquals(event6copy, expectedEvent6);
|
assertEquals(event6copy, expectedEvent6);
|
||||||
});
|
});
|
||||||
|
|
|
@ -80,7 +80,7 @@ function assembleEvents(
|
||||||
if (event.kind === 1) {
|
if (event.kind === 1) {
|
||||||
const id = event.tags.find(([name]) => name === 'q')?.[1];
|
const id = event.tags.find(([name]) => name === 'q')?.[1];
|
||||||
if (id) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
|
||||||
tags: [],
|
tags: [],
|
||||||
emojis: renderEmojis(event),
|
emojis: renderEmojis(event),
|
||||||
poll: null,
|
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,
|
quote_id: event.tags.find(([name]) => name === 'q')?.[1] ?? null,
|
||||||
uri: Conf.external(note),
|
uri: Conf.external(note),
|
||||||
url: Conf.external(note),
|
url: Conf.external(note),
|
||||||
|
|
Loading…
Reference in New Issue