[backend] Fix mention host fallback

This commit is contained in:
Laura Hausmann 2023-10-18 17:18:38 +02:00
parent 1351fb686a
commit 8b699248af
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -221,7 +221,7 @@ export async function resolveMentionFromCache(username: string, host: string | n
}
const fallback = getMentionFallbackUri(username, host, objectHost);
const cached = cache.find(r => r.username.toLowerCase() === username.toLowerCase() && r.host === host);
const cached = cache.find(r => r.username.toLowerCase() === username.toLowerCase() && r.host === (host ?? objectHost));
const href = cached?.url ?? cached?.uri;
if (cached && href != null) return { username: cached.username, href: href };
if (isLocal) return { username: username, href: fallback };