]> nmode's Git Repositories - signal-cli/commitdiff
Add fallback locale for voice verification
authorAsamK <asamk@gmx.de>
Sun, 20 Nov 2022 10:27:33 +0000 (11:27 +0100)
committerAsamK <asamk@gmx.de>
Sun, 20 Nov 2022 10:27:33 +0000 (11:27 +0100)
Fixes #1101

lib/src/main/java/org/asamk/signal/manager/util/NumberVerificationUtils.java

index 9dcee1fb863a11f4385a2cb3961d369ef0af34c4..280c9fbcee1583ea5974ef5eb5b3bd3f333880f8 100644 (file)
@@ -15,6 +15,7 @@ import org.whispersystems.signalservice.internal.push.RequestVerificationCodeRes
 import org.whispersystems.signalservice.internal.push.VerifyAccountResponse;
 
 import java.io.IOException;
+import java.util.Locale;
 import java.util.Optional;
 
 public class NumberVerificationUtils {
@@ -23,10 +24,9 @@ public class NumberVerificationUtils {
             SignalServiceAccountManager accountManager, String captcha, boolean voiceVerification
     ) throws IOException, CaptchaRequiredException, NonNormalizedPhoneNumberException {
         captcha = captcha == null ? null : captcha.replace("signalcaptcha://", "");
-
         final ServiceResponse<RequestVerificationCodeResponse> response;
         if (voiceVerification) {
-            response = accountManager.requestVoiceVerificationCode(Utils.getDefaultLocale(null),
+            response = accountManager.requestVoiceVerificationCode(Utils.getDefaultLocale(Locale.US),
                     Optional.ofNullable(captcha),
                     Optional.empty(),
                     Optional.empty());