X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/62dd2ee49ebcc182fb3892648c3f3f3840d38652..d3490facc84a130551d9b4cf6a7baf701b2b10a6:/lib/src/main/java/org/asamk/signal/manager/RegistrationManager.java diff --git a/lib/src/main/java/org/asamk/signal/manager/RegistrationManager.java b/lib/src/main/java/org/asamk/signal/manager/RegistrationManager.java index 4ca12028..789173af 100644 --- a/lib/src/main/java/org/asamk/signal/manager/RegistrationManager.java +++ b/lib/src/main/java/org/asamk/signal/manager/RegistrationManager.java @@ -26,6 +26,7 @@ import org.asamk.signal.manager.helper.PinHelper; import org.asamk.signal.manager.storage.SignalAccount; import org.asamk.signal.manager.storage.identities.TrustNewIdentity; import org.asamk.signal.manager.util.KeyUtils; +import org.asamk.signal.manager.util.Utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.whispersystems.libsignal.util.KeyHelper; @@ -48,7 +49,6 @@ import org.whispersystems.signalservice.internal.util.DynamicCredentialsProvider import java.io.Closeable; import java.io.File; import java.io.IOException; -import java.util.Locale; public class RegistrationManager implements Closeable { @@ -123,7 +123,7 @@ public class RegistrationManager implements Closeable { public void register(boolean voiceVerification, String captcha) throws IOException, CaptchaRequiredException { final ServiceResponse response; if (voiceVerification) { - response = accountManager.requestVoiceVerificationCode(getDefaultLocale(), + response = accountManager.requestVoiceVerificationCode(Utils.getDefaultLocale(), Optional.fromNullable(captcha), Optional.absent(), Optional.absent()); @@ -140,18 +140,6 @@ public class RegistrationManager implements Closeable { } } - private Locale getDefaultLocale() { - final var locale = Locale.getDefault(); - try { - Locale.LanguageRange.parse(locale.getLanguage() + "-" + locale.getCountry()); - } catch (IllegalArgumentException e) { - logger.debug("Invalid locale, ignoring: {}", locale); - return null; - } - - return locale; - } - public Manager verifyAccount( String verificationCode, String pin ) throws IOException, PinLockedException, IncorrectPinException {