]> nmode's Git Repositories - signal-cli/commitdiff
Only store profile keys for group history if none is known yet
authorAsamK <asamk@gmx.de>
Thu, 6 Jun 2024 07:37:53 +0000 (09:37 +0200)
committerAsamK <asamk@gmx.de>
Thu, 6 Jun 2024 08:07:20 +0000 (10:07 +0200)
lib/src/main/java/org/asamk/signal/manager/helper/GroupHelper.java

index c0ca3871dded13ab06cc29b0775efe244e3dc346..0c15ceff3751d9dd800edbf5cfb5f5b2fffd6e5f 100644 (file)
@@ -500,7 +500,10 @@ public class GroupHelper {
             fromRevision = page.getPagingData().getNextPageRevision();
         }
 
-        newProfileKeys.forEach(account.getProfileStore()::storeProfileKey);
+        newProfileKeys.entrySet()
+                .stream()
+                .filter(entry -> account.getProfileStore().getProfileKey(entry.getKey()) == null)
+                .forEach(entry -> account.getProfileStore().storeProfileKey(entry.getKey(), entry.getValue()));
     }
 
     private GroupInfo getGroupForUpdating(GroupId groupId) throws GroupNotFoundException, NotAGroupMemberException {