Fix renderReblog on other Mastodon apps

This commit is contained in:
Alex Gleason 2024-05-26 12:55:01 -05:00
parent 3f9908449b
commit 875b678948
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
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,
};
}