yeet japan

This commit is contained in:
cutestnekoaqua 2022-12-07 01:16:35 +01:00
parent f47813cf0e
commit 874a197360

View file

@ -91,7 +91,7 @@ export default define(meta, paramDef, async (ps, me) => {
* Resolve User or Note from URI * Resolve User or Note from URI
*/ */
async function fetchAny(uri: string, me: CacheableLocalUser | null | undefined): Promise<SchemaType<typeof meta['res']> | null> { async function fetchAny(uri: string, me: CacheableLocalUser | null | undefined): Promise<SchemaType<typeof meta['res']> | null> {
// ブロックしてたら中断 // Wait if blocked.
const fetchedMeta = await fetchMeta(); const fetchedMeta = await fetchMeta();
if (fetchedMeta.blockedHosts.includes(extractDbHost(uri))) return null; if (fetchedMeta.blockedHosts.includes(extractDbHost(uri))) return null;
@ -103,12 +103,12 @@ async function fetchAny(uri: string, me: CacheableLocalUser | null | undefined):
])); ]));
if (local != null) return local; if (local != null) return local;
// リモートから一旦オブジェクトフェッチ // fetching Object once from remote
const resolver = new Resolver(); const resolver = new Resolver();
const object = await resolver.resolve(uri) as any; const object = await resolver.resolve(uri) as any;
// /@user のような正規id以外で取得できるURIが指定されていた場合、ここで初めて正規URIが確定する // /@user If a URI other than the id is specified,
// これはDBに存在する可能性があるため再度DB検索 // the URI is determined here
if (uri !== object.id) { if (uri !== object.id) {
local = await mergePack(me, ...await Promise.all([ local = await mergePack(me, ...await Promise.all([
dbResolver.getUserFromApId(object.id), dbResolver.getUserFromApId(object.id),