mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Refactor trusted recipient resolver
This commit is contained in:
parent
7b0744ec75
commit
f8ea631b03
2 changed files with 11 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue