]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java
Paralellize profile fetching
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / ManagerImpl.java
index 2fb3ae568cde6ad329762d0586553f89d35735dc..dd74d22c48f0296cf9029a495ddcf764fb8eb655 100644 (file)
@@ -78,6 +78,7 @@ import org.whispersystems.signalservice.api.messages.SignalServiceTypingMessage;
 import org.whispersystems.signalservice.api.push.ACI;
 import org.whispersystems.signalservice.api.push.SignalServiceAddress;
 import org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedException;
+import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
 import org.whispersystems.signalservice.api.util.DeviceNameUtil;
 import org.whispersystems.signalservice.api.util.InvalidNumberException;
 import org.whispersystems.signalservice.api.util.PhoneNumberFormatter;
@@ -196,8 +197,7 @@ public class ManagerImpl implements Manager {
                 avatarStore,
                 unidentifiedAccessHelper::getAccessFor,
                 this::resolveSignalServiceAddress);
-        final GroupV2Helper groupV2Helper = new GroupV2Helper(profileHelper::getRecipientProfileKeyCredential,
-                profileHelper::getRecipientProfile,
+        final GroupV2Helper groupV2Helper = new GroupV2Helper(profileHelper,
                 account::getSelfRecipientId,
                 dependencies.getGroupsV2Operations(),
                 dependencies.getGroupsV2Api(),
@@ -209,7 +209,7 @@ public class ManagerImpl implements Manager {
                 account.getRecipientStore(),
                 this::handleIdentityFailure,
                 this::getGroupInfo,
-                profileHelper::getRecipientProfile,
+                profileHelper,
                 this::refreshRegisteredUser);
         this.groupHelper = new GroupHelper(account,
                 dependencies,
@@ -911,11 +911,11 @@ public class ManagerImpl implements Manager {
         try {
             aciMap = getRegisteredUsers(Set.of(number));
         } catch (NumberFormatException e) {
-            throw new IOException(number, e);
+            throw new UnregisteredUserException(number, e);
         }
         final var uuid = aciMap.get(number);
         if (uuid == null) {
-            throw new IOException(number, null);
+            throw new UnregisteredUserException(number, null);
         }
         return uuid;
     }
@@ -1252,6 +1252,7 @@ public class ManagerImpl implements Manager {
         logger.debug("Handling message actions");
         var interrupted = false;
         for (var action : queuedActions) {
+            logger.debug("Executing action {}", action.getClass().getSimpleName());
             try {
                 action.execute(context);
             } catch (Throwable e) {