improve(backend): Skip note score incrementing when bots reacted (#9367)
fix Improved code quality fix small fix
This commit is contained in:
parent
bebcaad23b
commit
fe158339da
3 changed files with 9 additions and 7 deletions
|
@ -49,13 +49,13 @@ export class NoteDeleteService {
|
|||
* @param user 投稿者
|
||||
* @param note 投稿
|
||||
*/
|
||||
async delete(user: { id: User['id']; uri: User['uri']; host: User['host']; }, note: Note, quiet = false) {
|
||||
async delete(user: { id: User['id']; uri: User['uri']; host: User['host']; isBot: User['isBot']; }, note: Note, quiet = false) {
|
||||
const deletedAt = new Date();
|
||||
|
||||
// この投稿を除く指定したユーザーによる指定したノートのリノートが存在しないとき
|
||||
if (note.renoteId && (await this.noteEntityService.countSameRenotes(user.id, note.renoteId, note.id)) === 0) {
|
||||
this.notesRepository.decrement({ id: note.renoteId }, 'renoteCount', 1);
|
||||
this.notesRepository.decrement({ id: note.renoteId }, 'score', 1);
|
||||
if (!user.isBot) this.notesRepository.decrement({ id: note.renoteId }, 'score', 1);
|
||||
}
|
||||
|
||||
if (note.replyId) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue