Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed wrong code block in if/else statement - caused by stupid strgc/strgv #165

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,8 @@ public void sendEmails() throws NoSuchPaddingException, IllegalBlockSizeExceptio
mailUser, mensa);
}
}
} else {
} else { // if the user is not enabled (he doesn't want emails) but maybe the push notification
for (Mensa mensa : mailUser.getMensas()) {
Result<MailUser, MailError> mailResult = mailer.sendSpeiseplan(mailUser, mealsService.findAllMealsByServingDateAndMensa(today, mensa), mensa, false);
if (mailResult.isSuccess()) {
mailCounterSuccess.increment();
log.info("Regular mail sent to {} for mensa {}", mailUser.getEmail(), mensa.getName());
} else {
mailCounterFailure.increment();
errorEntityRepository.save(new ErrorEntity(mailResult.getError().message(), mailResult.getError().error().getCode(), Application.DATA_DISPATCHER));
}
if (mailUser.isPushNotificationsEnabled()) {
sendPushNotification(buildMealMessage(mealsService.findAllMealsByServingDateAndMensa(today, mensa), mailUser),
"Speiseplan - " + LocalDate.now().format(java.time.format.DateTimeFormatter.ofPattern("dd.MM.yyyy")) + " - " + mensa.getName(),
Expand Down Expand Up @@ -270,7 +262,7 @@ public List<Result<MailUser, MailError>> forceSendMail(Mensa wantedMensa) throws
mailUser, mensa);
}
}
} else {
} else { // if the user is not enabled (he doesn't want emails) but maybe the push notification
if (mailUser.isWantsUpdate()) {
if (mailUser.isPushNotificationsEnabled()) {
sendPushNotification("Wir haben Änderungen am heutigen Speiseplan für die Mensa " + mensa.getName() + " erkannt.",
Expand Down