Skip to content

Commit

Permalink
fix: MissionJoinEvent 조건 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kimyu0218 committed Dec 12, 2024
1 parent b9914bb commit 6434da1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ public void joinMission(final Long memberId, final InvitationCode invitationCode
missionValidator.validateMaxPersonnel(mission);
missionMemberRepository.save(MissionMember.join(member, mission));

if (member.isPushActivated() && mission.isHostMember(memberId)) {
eventPublisher.publishEvent(new JoinMissionEvent(mission.getId(), member.getDeviceToken(), member.getNickname()));
Long hostMemberId = mission.getHostMemberId();
Member hostMember = memberRepository.getMember(hostMemberId);
if (hostMember.isPushActivated() && !mission.isHostMember(memberId)) {
eventPublisher.publishEvent(
new JoinMissionEvent(mission.getId(), hostMember.getDeviceToken(), member.getNickname())
);
}

// TODO: 추후 필요없으면 삭제
Expand Down

0 comments on commit 6434da1

Please sign in to comment.