mirror of
https://github.com/hotomoe/hotomoe
synced 2024-11-25 15:46:17 +09:00
リストをインポートしたときにプロキシアカウントがフォローするように修正
This commit is contained in:
parent
c3d34bda37
commit
496f42805d
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user