improve(backend): Skip note score incrementing when bots reacted (#9367)

fix

Improved code quality

fix

small fix
This commit is contained in:
CyberRex 2022-12-21 10:23:03 +09:00 committed by GitHub
parent bebcaad23b
commit fe158339da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View file

@ -198,6 +198,7 @@ export class NoteCreateService {
host: User['host'];
isSilenced: User['isSilenced'];
createdAt: User['createdAt'];
isBot: User['isBot'];
}, data: Option, silent = false): Promise<Note> {
// チャンネル外にリプライしたら対象のスコープに合わせる
// (クライアントサイドでやっても良い処理だと思うけどとりあえずサーバーサイドで)
@ -415,6 +416,7 @@ export class NoteCreateService {
host: User['host'];
isSilenced: User['isSilenced'];
createdAt: User['createdAt'];
isBot: User['isBot'];
}, data: Option, silent: boolean, tags: string[], mentionedUsers: MinimumUser[]) {
// 統計を更新
this.notesChart.update(note, true);
@ -484,7 +486,7 @@ export class NoteCreateService {
// この投稿を除く指定したユーザーによる指定したノートのリノートが存在しないとき
if (data.renote && (await this.noteEntityService.countSameRenotes(user.id, data.renote.id, note.id) === 0)) {
this.incRenoteCount(data.renote);
if (!user.isBot) this.incRenoteCount(data.renote);
}
if (data.poll && data.poll.expiresAt) {