mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-28 21:08:52 -07:00
リストをインポートしたときにプロキシアカウントがフォローするように修正
This commit is contained in:
parent
0599b03ee8
commit
4473a8fd0a
1 changed files with 11 additions and 1 deletions
|
@ -6,7 +6,7 @@ import * as mongo from 'mongodb';
|
||||||
import * as request from 'request';
|
import * as request from 'request';
|
||||||
|
|
||||||
import { queueLogger } from '../../logger';
|
import { queueLogger } from '../../logger';
|
||||||
import User from '../../../models/user';
|
import User, { isRemoteUser, fetchProxyAccount } from '../../../models/user';
|
||||||
import config from '../../../config';
|
import config from '../../../config';
|
||||||
import UserList from '../../../models/user-list';
|
import UserList from '../../../models/user-list';
|
||||||
import DriveFile from '../../../models/drive-file';
|
import DriveFile from '../../../models/drive-file';
|
||||||
|
@ -14,6 +14,9 @@ import chalk from 'chalk';
|
||||||
import { getOriginalUrl } from '../../../misc/get-drive-file-url';
|
import { getOriginalUrl } from '../../../misc/get-drive-file-url';
|
||||||
import parseAcct from '../../../misc/acct/parse';
|
import parseAcct from '../../../misc/acct/parse';
|
||||||
import resolveUser from '../../../remote/resolve-user';
|
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');
|
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
|
userIds: target._id
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// このインスタンス内にこのリモートユーザーをフォローしているユーザーがいなくても投稿を受け取るためにダミーのユーザーがフォローしたということにする
|
||||||
|
if (isRemoteUser(target)) {
|
||||||
|
const proxy = await fetchProxyAccount();
|
||||||
|
const content = renderActivity(renderFollow(proxy, user));
|
||||||
|
deliver(proxy, content, target.inbox);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.succ('Imported');
|
logger.succ('Imported');
|
||||||
|
|
Loading…
Reference in a new issue