Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53a08bcd authored by cketti's avatar cketti
Browse files

Fix mechanism to notify about messages that failed to send

parent 58281359
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -1551,10 +1551,16 @@ public class MessagingController {
                    long messageId = message.getDatabaseId();
                    OutboxState outboxState = outboxStateRepository.getOutboxState(messageId);

                    if (outboxState.getSendState() != SendState.READY) {
                        Timber.v("Skipping sending message %s", message.getUid());
                        notificationController.showSendFailedNotification(account,
                                new MessagingException(message.getSubject()));
                    SendState sendState = outboxState.getSendState();
                    if (sendState != SendState.READY) {
                        Timber.v("Skipping sending message %s (reason: %s)", message.getUid(),
                                sendState.getDatabaseName());

                        if (sendState == SendState.RETRIES_EXCEEDED) {
                            lastFailure = new MessagingException("Retries exceeded", true);
                        } else {
                            lastFailure = new MessagingException(outboxState.getSendError(), true);
                        }
                        continue;
                    }