fix: comment emit event scope

This commit is contained in:
Innei
2022-05-02 17:34:24 +08:00
parent fb057e8f32
commit ed424e09d3

View File

@@ -146,16 +146,18 @@ export class CommentController {
if (await this.commentService.checkSpam(comment)) {
comment.state = CommentState.Junk
await comment.save()
return
} else if (!isMaster) {
this.commentService.sendEmail(comment, ReplyMailType.Owner)
await this.eventManager.broadcast(
BusinessEvents.COMMENT_CREATE,
comment,
{
scope: EventScope.ALL,
},
)
}
await this.eventManager.broadcast(
BusinessEvents.COMMENT_CREATE,
comment,
{
scope: isMaster ? EventScope.TO_SYSTEM_VISITOR : EventScope.ALL,
},
)
})
return comment