fix: resolve account URLs in search, not just @-handles

Search with resolve=true only tried remote account resolution for queries
containing "@". Pasting an actor URL (https://instance/users/...) returned
empty results because the URL has no "@". Now also resolves when the query
starts with "http".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-04-25 16:48:35 +02:00
parent 56a8b08498
commit 83d6af6cc9
+1 -1
View File
@@ -83,7 +83,7 @@ router.get("/api/v2/search", tokenRequired, scopeRequired("read", "read:search")
} }
// If no local results and resolve=true, try remote lookup // If no local results and resolve=true, try remote lookup
if (results.accounts.length === 0 && resolve && query.includes("@")) { if (results.accounts.length === 0 && resolve && (query.includes("@") || query.startsWith("http"))) {
const resolved = await resolveRemoteAccount(query, pluginOptions, baseUrl, collections); const resolved = await resolveRemoteAccount(query, pluginOptions, baseUrl, collections);
if (resolved) { if (resolved) {
results.accounts.push(resolved); results.accounts.push(resolved);