diff --git a/src/queue/processors/db/import-user-lists.ts b/src/queue/processors/db/import-user-lists.ts index ee1468d5ae..aad11df7f2 100644 --- a/src/queue/processors/db/import-user-lists.ts +++ b/src/queue/processors/db/import-user-lists.ts @@ -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 { userIds: target._id } }); + + // このインスタンス内にこのリモートユーザーをフォローしているユーザーがいなくても投稿を受け取るためにダミーのユーザーがフォローしたということにする + if (isRemoteUser(target)) { + const proxy = await fetchProxyAccount(); + const content = renderActivity(renderFollow(proxy, user)); + deliver(proxy, content, target.inbox); + } } logger.succ('Imported');