X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/38267fa2a121319c0c28cd5d50a4b939f59229d5..644aacf59516dd1ecafc58878d287557f20dc112:/src/main/java/org/asamk/signal/manager/ProvisioningManager.java diff --git a/src/main/java/org/asamk/signal/manager/ProvisioningManager.java b/src/main/java/org/asamk/signal/manager/ProvisioningManager.java index 0648c0d3..0c26cf77 100644 --- a/src/main/java/org/asamk/signal/manager/ProvisioningManager.java +++ b/src/main/java/org/asamk/signal/manager/ProvisioningManager.java @@ -20,6 +20,8 @@ import org.asamk.signal.manager.storage.SignalAccount; import org.asamk.signal.manager.util.KeyUtils; import org.signal.zkgroup.InvalidInputException; import org.signal.zkgroup.profiles.ProfileKey; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.whispersystems.libsignal.IdentityKeyPair; import org.whispersystems.libsignal.InvalidKeyException; import org.whispersystems.libsignal.util.KeyHelper; @@ -38,6 +40,8 @@ import java.util.concurrent.TimeoutException; public class ProvisioningManager { + private final static Logger logger = LoggerFactory.getLogger(ProvisioningManager.class); + private final PathConfig pathConfig; private final SignalServiceConfiguration serviceConfiguration; private final String userAgent; @@ -66,6 +70,7 @@ public class ProvisioningManager { new DynamicCredentialsProvider(null, null, password, null, SignalServiceAddress.DEFAULT_DEVICE_ID), userAgent, groupsV2Operations, + ServiceConfig.AUTOMATIC_NETWORK_RETRY, timer); } @@ -117,12 +122,23 @@ public class ProvisioningManager { try (Manager m = new Manager(account, pathConfig, serviceConfiguration, userAgent)) { - m.refreshPreKeys(); - - m.requestSyncGroups(); - m.requestSyncContacts(); - m.requestSyncBlocked(); - m.requestSyncConfiguration(); + try { + m.refreshPreKeys(); + } catch (Exception e) { + logger.error("Failed to refresh prekeys."); + throw e; + } + + try { + m.requestSyncGroups(); + m.requestSyncContacts(); + m.requestSyncBlocked(); + m.requestSyncConfiguration(); + m.requestSyncKeys(); + } catch (Exception e) { + logger.error("Failed to request sync messages from linked device."); + throw e; + } m.close(false); }