]> nmode's Git Repositories - signal-cli/commitdiff
Refactor trusted recipient resolver
authorAsamK <asamk@gmx.de>
Sat, 11 Nov 2023 12:17:36 +0000 (13:17 +0100)
committerAsamK <asamk@gmx.de>
Sat, 11 Nov 2023 16:24:45 +0000 (17:24 +0100)
lib/src/main/java/org/asamk/signal/manager/storage/recipients/RecipientStore.java
lib/src/main/java/org/asamk/signal/manager/storage/recipients/RecipientTrustedResolver.java

index bc7475b74efa0b35e8a1f1485e034a89252a635b..668366fe57b8a2ef142599df7a5b67c9b1d4b7ca 100644 (file)
@@ -275,13 +275,14 @@ public class RecipientStore implements RecipientIdCreator, RecipientResolver, Re
         return resolveRecipientTrusted(address, true);
     }
 
+    @Override
     public RecipientId resolveRecipientTrusted(RecipientAddress address) {
         return resolveRecipientTrusted(address, false);
     }
 
     @Override
     public RecipientId resolveRecipientTrusted(SignalServiceAddress address) {
-        return resolveRecipientTrusted(new RecipientAddress(address), false);
+        return resolveRecipientTrusted(new RecipientAddress(address));
     }
 
     @Override
@@ -289,12 +290,12 @@ public class RecipientStore implements RecipientIdCreator, RecipientResolver, Re
             final Optional<ACI> aci, final Optional<PNI> pni, final Optional<String> number
     ) {
         final var serviceId = aci.map(a -> (ServiceId) a).or(() -> pni);
-        return resolveRecipientTrusted(new RecipientAddress(serviceId, pni, number, Optional.empty()), false);
+        return resolveRecipientTrusted(new RecipientAddress(serviceId, pni, number, Optional.empty()));
     }
 
     @Override
     public RecipientId resolveRecipientTrusted(final ACI aci, final String username) {
-        return resolveRecipientTrusted(new RecipientAddress(aci, null, null, username), false);
+        return resolveRecipientTrusted(new RecipientAddress(aci, null, null, username));
     }
 
     @Override
index 21708551ac7845f4332a9a2a74d410df702ba4e9..598ef791f8dd8618faa50c8944d1fd8a3e43541b 100644 (file)
@@ -11,6 +11,8 @@ public interface RecipientTrustedResolver {
 
     RecipientId resolveSelfRecipientTrusted(RecipientAddress address);
 
+    RecipientId resolveRecipientTrusted(RecipientAddress address);
+
     RecipientId resolveRecipientTrusted(SignalServiceAddress address);
 
     RecipientId resolveRecipientTrusted(Optional<ACI> aci, Optional<PNI> pni, Optional<String> number);
@@ -30,6 +32,11 @@ public interface RecipientTrustedResolver {
             return recipientTrustedResolverSupplier.get().resolveSelfRecipientTrusted(address);
         }
 
+        @Override
+        public RecipientId resolveRecipientTrusted(final RecipientAddress address) {
+            return recipientTrustedResolverSupplier.get().resolveRecipientTrusted(address);
+        }
+
         @Override
         public RecipientId resolveRecipientTrusted(final SignalServiceAddress address) {
             return recipientTrustedResolverSupplier.get().resolveRecipientTrusted(address);