Add fallback locale for voice verification

Fixes #1101
This commit is contained in:
AsamK 2022-11-20 11:27:33 +01:00
parent 5771bb858f
commit b6e9dfa97d

View file

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