diff --git a/src/queue/processors/db/import-following.ts b/src/queue/processors/db/import-following.ts index ad9129c1f549629df69479bdd8731ae54f0d3e65..a1242b71c8fde3451f506b118af9db1bc95f3e54 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<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); diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 5f69329a4e4043cbd7148ff5c5a1b0695e35a68a..85201086d40d02a9bad11569c8a8ece73030b9f7 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[] = [];