]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/RegistrationManagerImpl.java
Update libsignal-service-java
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / RegistrationManagerImpl.java
index 509b8923bc0711765540273b3738550e3c4475f9..337aa348ae3811449d83b7d43843dcd4a7d7de37 100644 (file)
@@ -18,6 +18,7 @@ package org.asamk.signal.manager;
 
 import org.asamk.signal.manager.api.CaptchaRequiredException;
 import org.asamk.signal.manager.api.IncorrectPinException;
+import org.asamk.signal.manager.api.NonNormalizedPhoneNumberException;
 import org.asamk.signal.manager.api.PinLockedException;
 import org.asamk.signal.manager.api.UpdateProfile;
 import org.asamk.signal.manager.config.ServiceConfig;
@@ -95,7 +96,9 @@ class RegistrationManagerImpl implements RegistrationManager {
     }
 
     @Override
-    public void register(boolean voiceVerification, String captcha) throws IOException, CaptchaRequiredException {
+    public void register(
+            boolean voiceVerification, String captcha
+    ) throws IOException, CaptchaRequiredException, NonNormalizedPhoneNumberException {
         if (account.isRegistered()
                 && account.getServiceEnvironment() != null
                 && account.getServiceEnvironment() != serviceEnvironmentConfig.getType()) {
@@ -179,12 +182,13 @@ class RegistrationManagerImpl implements RegistrationManager {
                     account.getLocalRegistrationId(),
                     true,
                     null,
-                    account.getPinMasterKey() == null ? null : account.getPinMasterKey().deriveRegistrationLock(),
+                    account.getRegistrationLock(),
                     account.getSelfUnidentifiedAccessKey(),
                     account.isUnrestrictedUnidentifiedAccess(),
                     capabilities,
                     account.isDiscoverableByPhoneNumber(),
-                    account.getEncryptedDeviceName());
+                    account.getEncryptedDeviceName(),
+                    account.getLocalPniRegistrationId());
             account.setRegistered(true);
             logger.info("Reactivated existing account, verify is not necessary.");
             if (newManagerListener != null) {
@@ -213,7 +217,8 @@ class RegistrationManagerImpl implements RegistrationManager {
                     account.getSelfUnidentifiedAccessKey(),
                     account.isUnrestrictedUnidentifiedAccess(),
                     ServiceConfig.capabilities,
-                    account.isDiscoverableByPhoneNumber());
+                    account.isDiscoverableByPhoneNumber(),
+                    account.getLocalPniRegistrationId());
         } else {
             return accountManager.verifyAccountWithRegistrationLockPin(verificationCode,
                     account.getLocalRegistrationId(),
@@ -222,7 +227,8 @@ class RegistrationManagerImpl implements RegistrationManager {
                     account.getSelfUnidentifiedAccessKey(),
                     account.isUnrestrictedUnidentifiedAccess(),
                     ServiceConfig.capabilities,
-                    account.isDiscoverableByPhoneNumber());
+                    account.isDiscoverableByPhoneNumber(),
+                    account.getLocalPniRegistrationId());
         }
     }