fedimbed: mastodon fallback try 4
This commit is contained in:
parent
e181188fa7
commit
cec88971b6
1 changed files with 2 additions and 1 deletions
|
@ -118,7 +118,8 @@ async function processUrl(msg, url) {
|
|||
if (PATH_REGEX.pleroma2.test(urlObj.pathname)) {
|
||||
redirUrl = url.replace("notice", "api/v1/statuses");
|
||||
} else if (PATH_REGEX.mastodon.test(urlObj.pathname)) {
|
||||
redirUrl = url.replace(/^\/@(.+?)\/(\d+)\/?/, "/api/v1/statuses/$2");
|
||||
const postId = url.match(/^\/@(.+?)\/(\d+)\/?/)?.[2];
|
||||
redirUrl = urlObj.origin + "/api/v1/statuses/" + postId;
|
||||
} else if (PATH_REGEX.mastodon2.test(urlObj.pathname)) {
|
||||
redirUrl = url.replace(/^\/(.+?)\/statuses/, "/api/v1/statuses");
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue