mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 16:58:47 +01:00
Test fix self-recursive quote posts
This commit is contained in:
parent
418895e1c3
commit
2a91c005a1
1 changed files with 10 additions and 0 deletions
|
@ -295,6 +295,16 @@ export function unfurlStatus(status, instance) {
|
||||||
unfurlMastodonLink(currentInstance, a.href).then((result) => {
|
unfurlMastodonLink(currentInstance, a.href).then((result) => {
|
||||||
if (!result) return;
|
if (!result) return;
|
||||||
if (!sKey) return;
|
if (!sKey) return;
|
||||||
|
if (result?.id === status.id) {
|
||||||
|
// Unfurled post is the post itself???
|
||||||
|
// Scenario:
|
||||||
|
// 1. Post with [URL]
|
||||||
|
// 2. Unfurl [URL], API returns the same post that contains [URL]
|
||||||
|
// 3. 💥 Recursive quote posts 💥
|
||||||
|
// Note: Mastodon search doesn't return posts that contains [URL], it's actually used to *resolve* the URL
|
||||||
|
// But some non-Mastodon servers, their search API will eventually search posts that contains [URL] and return them
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!Array.isArray(states.statusQuotes[sKey])) {
|
if (!Array.isArray(states.statusQuotes[sKey])) {
|
||||||
states.statusQuotes[sKey] = [];
|
states.statusQuotes[sKey] = [];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue