blob: 74591846fa007ce37047db6d78c14676bd0f0516 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import { createSystemUser } from './create-system-user';
import { ILocalUser } from '../models/entities/user';
import { Users } from '../models';
const ACTOR_USERNAME = 'instance.actor' as const;
export async function getInstanceActor(): Promise<ILocalUser> {
const user = await Users.findOne({
host: null,
username: ACTOR_USERNAME
});
if (user) return user as ILocalUser;
const created = await createSystemUser(ACTOR_USERNAME);
return created as ILocalUser;
}
|