mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 18:07:31 -07:00
cleo ide moment
This commit is contained in:
parent
bb7678fd45
commit
b93d390af8
1 changed files with 18 additions and 16 deletions
|
@ -1,17 +1,18 @@
|
||||||
|
import { URL } from 'url';
|
||||||
import { In, Not } from 'typeorm';
|
import { In, Not } from 'typeorm';
|
||||||
import Ajv from 'ajv';
|
import Ajv from 'ajv';
|
||||||
import {ILocalUser, IRemoteUser, User} from '@/models/entities/user.js';
|
import type { ILocalUser, IRemoteUser } from '@/models/entities/user.js';
|
||||||
|
import { User } from '@/models/entities/user.js';
|
||||||
import config from '@/config/index.js';
|
import config from '@/config/index.js';
|
||||||
import {Packed} from '@/misc/schema.js';
|
import type { Packed } from '@/misc/schema.js';
|
||||||
import {awaitAll, Promiseable} from '@/prelude/await-all.js';
|
import type { Promiseable } from '@/prelude/await-all.js';
|
||||||
|
import { awaitAll } from '@/prelude/await-all.js';
|
||||||
import { populateEmojis } from '@/misc/populate-emojis.js';
|
import { populateEmojis } from '@/misc/populate-emojis.js';
|
||||||
import { getAntennas } from '@/misc/antenna-cache.js';
|
import { getAntennas } from '@/misc/antenna-cache.js';
|
||||||
import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from '@/const.js';
|
import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from '@/const.js';
|
||||||
import { Cache } from '@/misc/cache.js';
|
import { Cache } from '@/misc/cache.js';
|
||||||
import { db } from '@/db/postgre.js';
|
import { db } from '@/db/postgre.js';
|
||||||
import {Instance} from '../entities/instance.js';
|
import { resolveUser } from '@/remote/resolve-user.js';
|
||||||
import {resolveUser} from "@/remote/resolve-user";
|
|
||||||
import {URL} from "url";
|
|
||||||
import {
|
import {
|
||||||
AnnouncementReads,
|
AnnouncementReads,
|
||||||
Announcements,
|
Announcements,
|
||||||
|
@ -31,8 +32,9 @@ import {
|
||||||
UserGroupJoinings,
|
UserGroupJoinings,
|
||||||
UserNotePinings,
|
UserNotePinings,
|
||||||
UserProfiles,
|
UserProfiles,
|
||||||
UserSecurityKeys
|
UserSecurityKeys,
|
||||||
} from '../index.js';
|
} from '../index.js';
|
||||||
|
import type { Instance } from '../entities/instance.js';
|
||||||
|
|
||||||
const userInstanceCache = new Cache<Instance | null>(1000 * 60 * 60 * 3);
|
const userInstanceCache = new Cache<Instance | null>(1000 * 60 * 60 * 3);
|
||||||
|
|
||||||
|
@ -185,10 +187,10 @@ export const UserRepository = db.getRepository(User).extend({
|
||||||
return await resolveUser(id, null);
|
return await resolveUser(id, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
let url = new URL(uri);
|
const url = new URL(uri);
|
||||||
let userTag = url.pathname;
|
let userTag = url.pathname;
|
||||||
|
|
||||||
if (userTag.startsWith("@")) {
|
if (userTag.startsWith('@')) {
|
||||||
userTag = userTag.substring(1);
|
userTag = userTag.substring(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue