From 8b699248af685ddc604bfade30f692b321e0a232 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Wed, 18 Oct 2023 17:18:38 +0200 Subject: [PATCH] [backend] Fix mention host fallback --- packages/backend/src/remote/resolve-user.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/remote/resolve-user.ts b/packages/backend/src/remote/resolve-user.ts index 4c9ec94a3..81a957634 100644 --- a/packages/backend/src/remote/resolve-user.ts +++ b/packages/backend/src/remote/resolve-user.ts @@ -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 };