mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 18:07:31 -07:00
yeet japan
This commit is contained in:
parent
abe351c283
commit
157134a4d2
1 changed files with 4 additions and 4 deletions
|
@ -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),
|
||||||
|
|
Loading…
Reference in a new issue