Skip to content

Commit

Permalink
Fix : 댓글 알람 기능 수정
Browse files Browse the repository at this point in the history
본인의 게시글에 댓글 달은 경우에 알람 전송하지 않도록 변경
  • Loading branch information
ekzot1212 committed Jul 25, 2024
1 parent 4f4e514 commit ed4c7f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/nbdream/alarm/service/AlarmService.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ public void deleteFcmToken(Long memberId) {
alarmRepository.save(alarm);
}

public void sendCommentAlarm(Bulletin bulletin, String nickname) {
public void sendCommentAlarm(Bulletin bulletin, String nickname, Long commentAuthorId) {
Alarm alarm = alarmRepository.findByMemberId(bulletin.getAuthor().getId());
isAlarmValid(alarm);
if(!alarm.isCommentAlarm()){
if(!alarm.isCommentAlarm() || bulletin.getAuthor().getId() == commentAuthorId){
return;
}
hasToken(alarm);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/nbdream/comment/service/CommentService.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public Long postComment(Long bulletinId, CreatePostRequest request, Long memberI
.build();
commentEntity = commentRepository.save(commentEntity);

//게시글 작성자에게 push 알람 전송 (게시글 작성자 id, 댓글작성자 닉네임, 게시글 id)
alarmService.sendCommentAlarm(bulletinEntity, memberEntity.getNickname());
//게시글 작성자에게 push 알람 전송 (게시글 작성자 id, 댓글작성자 닉네임, 댓글 작성자 id)
alarmService.sendCommentAlarm(bulletinEntity, memberEntity.getNickname(), memberId);
return commentEntity.getId();
}

Expand Down

0 comments on commit ed4c7f0

Please sign in to comment.