Skip to content
Snippets Groups Projects
Commit 59dc9294 authored by MeiMei's avatar MeiMei Committed by syuilo
Browse files

フォローインポートで自分をスキップするように (#4614)

* skip myself in import-following

* skip owner in publishToFollowers
parent deaadc33
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,9 @@ export async function importFollowing(job: Bull.Job, done: any): Promise<void> {
target = await resolveUser(username, host);
}
// skip myself
if (target._id.equals(job.data.user._id)) continue;
logger.info(`Follow ${target._id} ...`);
follow(user, target);
......
......@@ -568,7 +568,8 @@ async function publishToFollowers(note: INote, user: IUser, noteActivity: any) {
});
const followers = await Following.find({
followeeId: note.userId
followeeId: note.userId,
followerId: { $ne: note.userId } // バグでフォロワーに自分がいることがあるため
});
const queue: string[] = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment