diff --git a/src/queue/processors/db/import-following.ts b/src/queue/processors/db/import-following.ts index ad9129c1f..a1242b71c 100644 --- a/src/queue/processors/db/import-following.ts +++ b/src/queue/processors/db/import-following.ts @@ -45,6 +45,9 @@ export async function importFollowing(job: Bull.Job, done: any): Promise { target = await resolveUser(username, host); } + // skip myself + if (target._id.equals(job.data.user._id)) continue; + logger.info(`Follow ${target._id} ...`); follow(user, target); diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 5f69329a4..85201086d 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -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[] = [];