yeet japan

This commit is contained in:
cutestnekoaqua 2022-12-07 01:16:35 +01:00
parent abe351c283
commit 157134a4d2

View File

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