diff --git a/src/main/java/org/signal/registration/RegistrationService.java b/src/main/java/org/signal/registration/RegistrationService.java index 6f89611..f74b609 100644 --- a/src/main/java/org/signal/registration/RegistrationService.java +++ b/src/main/java/org/signal/registration/RegistrationService.java @@ -190,6 +190,13 @@ public CompletableFuture sendVerificationCode(final Message .map(RegistrationAttempt::getSenderName) .collect(Collectors.toSet()); + // Add senders from failed attempts with a "provider unavailable" error + session.getFailedAttemptsList() + .stream() + .filter(attempt -> attempt.getFailedSendReason() == FailedSendReason.FAILED_SEND_REASON_UNAVAILABLE) + .map(FailedSendAttempt::getSenderName) + .forEach(previouslyFailedSenders::add); + final SenderSelection selection = senderSelectionStrategy.chooseVerificationCodeSender( messageTransport, phoneNumberFromSession, languageRanges, clientType, senderName, previouslyFailedSenders);