1
0
Fork 1
mirror of https://example.com synced 2024-11-23 12:46:38 +09:00

リストをインポートしたときにプロキシアカウントがフォローするように修正

This commit is contained in:
syuilo 2019-03-11 19:51:58 +09:00
parent c3d34bda37
commit 496f42805d
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69

View file

@ -6,7 +6,7 @@ import * as mongo from 'mongodb';
import * as request from 'request';
import { queueLogger } from '../../logger';
import User from '../../../models/user';
import User, { isRemoteUser, fetchProxyAccount } from '../../../models/user';
import config from '../../../config';
import UserList from '../../../models/user-list';
import DriveFile from '../../../models/drive-file';
@ -14,6 +14,9 @@ import chalk from 'chalk';
import { getOriginalUrl } from '../../../misc/get-drive-file-url';
import parseAcct from '../../../misc/acct/parse';
import resolveUser from '../../../remote/resolve-user';
import { renderActivity } from '../../../remote/activitypub/renderer';
import renderFollow from '../../../remote/activitypub/renderer/follow';
import { deliver } from '../..';
const logger = queueLogger.createSubLogger('import-user-lists');
@ -132,6 +135,13 @@ export async function importUserLists(job: Bull.Job, done: any): Promise<void> {
userIds: target._id
}
});
// このインスタンス内にこのリモートユーザーをフォローしているユーザーがいなくても投稿を受け取るためにダミーのユーザーがフォローしたということにする
if (isRemoteUser(target)) {
const proxy = await fetchProxyAccount();
const content = renderActivity(renderFollow(proxy, user));
deliver(proxy, content, target.inbox);
}
}
logger.succ('Imported');