]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java
Refactor identity key store
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / ManagerImpl.java
index daff69e026973b2f71b93b22ea2a92e9555f0dc1..201f093121faef35148ac5c3160cf9e2ba61928d 100644 (file)
@@ -705,12 +705,13 @@ class ManagerImpl implements Manager {
 
     @Override
     public void setContactName(
-            RecipientIdentifier.Single recipient, String name
+            RecipientIdentifier.Single recipient, String givenName, final String familyName
     ) throws NotPrimaryDeviceException, UnregisteredRecipientException {
         if (!account.isPrimaryDevice()) {
             throw new NotPrimaryDeviceException();
         }
-        context.getContactHelper().setContactName(context.getRecipientHelper().resolveRecipient(recipient), name);
+        context.getContactHelper()
+                .setContactName(context.getRecipientHelper().resolveRecipient(recipient), givenName, familyName);
     }
 
     @Override
@@ -859,7 +860,8 @@ class ManagerImpl implements Manager {
             logger.debug("Starting receiving messages");
             context.getReceiveHelper().receiveMessagesContinuously((envelope, e) -> {
                 synchronized (messageHandlers) {
-                    Stream.concat(messageHandlers.stream(), weakHandlers.stream()).forEach(h -> {
+                    final var handlers = Stream.concat(messageHandlers.stream(), weakHandlers.stream()).toList();
+                    handlers.forEach(h -> {
                         try {
                             h.handleMessage(envelope, e);
                         } catch (Throwable ex) {
@@ -1047,7 +1049,7 @@ class ManagerImpl implements Manager {
         IdentityInfo identity;
         try {
             identity = account.getIdentityKeyStore()
-                    .getIdentity(context.getRecipientHelper().resolveRecipient(recipient));
+                    .getIdentityInfo(context.getRecipientHelper().resolveRecipient(recipient));
         } catch (UnregisteredRecipientException e) {
             identity = null;
         }