Skip to content

Commit

Permalink
Merge pull request #165 from olech2412/bug/fix-strc-strv-issue
Browse files Browse the repository at this point in the history
removed wrong code block in if/else statement - caused by stupid strgc/strgv
  • Loading branch information
olech2412 authored Aug 30, 2024
2 parents f87943d + c2417b8 commit 1b38ad5
Showing 1 changed file with 2 additions and 10 deletions.
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

0 comments on commit 1b38ad5

Please sign in to comment.