[SIS-3] adding separator for the meetup members

adding member counter to message display
only notify member with yes/maybe decision of meetup cancellation
This commit is contained in:
Sheldan
2022-06-20 19:15:30 +02:00
parent 6ae631c78d
commit 533c9e3a63
2 changed files with 20 additions and 14 deletions

View File

@@ -147,12 +147,18 @@ public class MeetupServiceBean {
Meetup meetup = meetupManagementServiceBean.getMeetup(meetupId, serverId);
MeetupMessageModel model = getMeetupMessageModel(meetup);
MessageToSend messageToSend = templateService.renderEmbedTemplate(MEETUP_CANCELLATION_TEMPLATE, model);
meetup.getParticipants().forEach(meetupParticipator -> {
Long userId = meetupParticipator.getParticipator().getUserReference().getId();
userService.retrieveUserForId(userId)
.thenCompose(user -> messageService.sendMessageToSendToUser(user, messageToSend))
.thenAccept(message -> log.info("Notified user {} about cancellation of meetup {} in server {}.", userId, meetupId, serverId));
});
meetup
.getParticipants()
.stream()
.filter(meetupParticipator ->
meetupParticipator.getDecision().equals(MeetupDecision.MAYBE) ||
meetupParticipator.getDecision().equals(MeetupDecision.YES))
.forEach(meetupParticipator -> {
Long userId = meetupParticipator.getParticipator().getUserReference().getId();
userService.retrieveUserForId(userId)
.thenCompose(user -> messageService.sendMessageToSendToUser(user, messageToSend))
.thenAccept(message -> log.info("Notified user {} about cancellation of meetup {} in server {}.", userId, meetupId, serverId));
});
}
@Transactional
@@ -209,11 +215,11 @@ public class MeetupServiceBean {
meetupParticipator.getDecision().equals(MeetupDecision.MAYBE) ||
meetupParticipator.getDecision().equals(MeetupDecision.YES))
.forEach(meetupParticipator -> {
Long userId = meetupParticipator.getParticipator().getUserReference().getId();
userService.retrieveUserForId(userId)
.thenCompose(user -> messageService.sendMessageToSendToUser(user, messageToSend))
.thenAccept(message -> log.info("Notified user {} about incoming meetup {} in server {}.", userId, meetupId, serverId));
});
Long userId = meetupParticipator.getParticipator().getUserReference().getId();
userService.retrieveUserForId(userId)
.thenCompose(user -> messageService.sendMessageToSendToUser(user, messageToSend))
.thenAccept(message -> log.info("Notified user {} about incoming meetup {} in server {}.", userId, meetupId, serverId));
});
}
@Transactional