ghostの設定をDBに保存するように

This commit is contained in:
syuilo 2018-11-07 00:44:56 +09:00
parent 87d4452d19
commit 2de48110bb
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
9 changed files with 55 additions and 21 deletions

View file

@ -10,6 +10,7 @@ import Mute from './mute';
import { getFriendIds } from '../server/api/common/get-friends';
import config from '../config';
import FollowRequest from './follow-request';
import fetchMeta from '../misc/fetch-meta';
const User = db.get<IUser>('users');
@ -376,6 +377,7 @@ function img(url) {
}
*/
export function getGhost(): Promise<ILocalUser> {
return User.findOne({ _id: new mongo.ObjectId(config.ghost) });
export async function fetchProxyAccount(): Promise<ILocalUser> {
const meta = await fetchMeta();
return await User.findOne({ username: meta.proxyAccount, host: null }) as ILocalUser;
}