diff --git a/src/helpers/post/make-bluesky-post.ts b/src/helpers/post/make-bluesky-post.ts index e8971d6..5026fb7 100644 --- a/src/helpers/post/make-bluesky-post.ts +++ b/src/helpers/post/make-bluesky-post.ts @@ -35,11 +35,11 @@ export const makeBlueskyPost = async ( // Get in reply post references let replyPost = undefined; - if (tweet.inReplyToStatus) { + if (tweet.inReplyToStatusId) { const replyData = await getCachedPostChunk( Platform.BLUESKY, "last", - tweet.inReplyToStatus.id, + tweet.inReplyToStatusId, ); replyPost = replyData ? await client diff --git a/src/helpers/post/make-mastodon-post.ts b/src/helpers/post/make-mastodon-post.ts index 61f1b6e..97a87d4 100644 --- a/src/helpers/post/make-mastodon-post.ts +++ b/src/helpers/post/make-mastodon-post.ts @@ -21,10 +21,10 @@ export const makeMastodonPost = async ( // Get in reply post references let inReplyToId = undefined; - if (tweet.inReplyToStatus) { + if (tweet.inReplyToStatusId) { // Retrieve the potentially already synced post references const existingPost = - cachedPosts[tweet.inReplyToStatus.id!]?.[Platform.MASTODON]; + cachedPosts[tweet.inReplyToStatusId]?.[Platform.MASTODON]; // Set inReplyToId to the last chunk reference of the existing post inReplyToId = existingPost ? existingPost[existingPost.length - 1] diff --git a/src/helpers/tweet/get-eligible-tweet.ts b/src/helpers/tweet/get-eligible-tweet.ts index fcca983..eaa91af 100644 --- a/src/helpers/tweet/get-eligible-tweet.ts +++ b/src/helpers/tweet/get-eligible-tweet.ts @@ -20,7 +20,9 @@ export const getEligibleTweet = async ( const eligibleTweet = { ...tweet, inReplyToStatus: isSelfReply ? tweet.inReplyToStatus : undefined, - inReplyToStatusId: isSelfReply ? tweet.inReplyToStatusId : undefined, + inReplyToStatusId: isSelfReply + ? (tweet.inReplyToStatusId ?? tweet.inReplyToStatus?.id) + : undefined, quotedStatus: isSelfQuote ? tweet.quotedStatus : undefined, quotedStatusId: isSelfQuote ? tweet.quotedStatusId : undefined, };