Merge branch 'fix-reblog' into 'main'

Fix renderReblog on other Mastodon apps

See merge request soapbox-pub/ditto!323
This commit is contained in:
Alex Gleason 2024-05-26 17:57:40 +00:00
commit 1fff0834eb
1 changed files with 2 additions and 7 deletions

View File

@ -131,18 +131,13 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
async function renderReblog(event: DittoEvent, opts: RenderStatusOpts) {
const { viewerPubkey } = opts;
const repostId = event.tags.find(([name]) => name === 'e')?.[1];
if (!repostId) return;
if (!event.repost) return;
const status = await renderStatus(event, {}); // omit viewerPubkey intentionally
const reblog = await renderStatus(event.repost, { viewerPubkey });
return {
id: event.id,
account: event.author ? await renderAccount(event.author) : await accountFromPubkey(event.pubkey),
reblogged: true,
...status,
reblog,
};
}