From fc809c41f0257af1ad5fd4663c50ee123104aebc Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Mon, 23 Jun 2025 18:26:15 -0600 Subject: [PATCH] fedimbed: ple --- src/modules/fedimbed.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/fedimbed.js b/src/modules/fedimbed.js index 013b5df..3a7d2e1 100644 --- a/src/modules/fedimbed.js +++ b/src/modules/fedimbed.js @@ -840,16 +840,16 @@ async function fetchPost(url, platform, forceMastoAPI = false) { let redirUrl; const options = {}; const headers = {}; - if (PATH_REGEX.pleroma2.test(urlObj.pathname)) { + if (urlObj.hostname === "truthsocial.com") { + const postId = urlObj.pathname.match(PATH_REGEX.truthsocial)?.[2]; + redirUrl = urlObj.origin + "/api/v1/statuses/" + postId; + } else if (PATH_REGEX.pleroma2.test(urlObj.pathname)) { redirUrl = url.replace("notice", "api/v1/statuses"); } else if (PATH_REGEX.mastodon.test(urlObj.pathname)) { const postId = urlObj.pathname.match(PATH_REGEX.mastodon)?.[2]; redirUrl = urlObj.origin + "/api/v1/statuses/" + postId; } else if (PATH_REGEX.mastodon2.test(urlObj.pathname)) { redirUrl = url.replace(/^\/(.+?)\/statuses/, "/api/v1/statuses"); - } else if (urlObj.hostname === "truthsocial.com") { - const postId = urlObj.pathname.match(PATH_REGEX.truthsocial)?.[2]; - redirUrl = urlObj.origin + "/api/v1/statuses/" + postId; } else if (PATH_REGEX.misskey.test(urlObj.pathname)) { let noteId = url.split("/notes/")[1]; if (noteId.indexOf("/") > -1) {