mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Remove duplicate address resolving
This commit is contained in:
parent
106af6a801
commit
c62a1e829f
2 changed files with 14 additions and 8 deletions
|
@ -625,7 +625,16 @@
|
|||
"name":"org.asamk.signal.commands.ListIdentitiesCommand$JsonIdentity",
|
||||
"allDeclaredFields":true,
|
||||
"allDeclaredMethods":true,
|
||||
"allDeclaredConstructors":true
|
||||
"allDeclaredConstructors":true,
|
||||
"methods":[
|
||||
{"name":"addedTimestamp","parameterTypes":[] },
|
||||
{"name":"fingerprint","parameterTypes":[] },
|
||||
{"name":"number","parameterTypes":[] },
|
||||
{"name":"safetyNumber","parameterTypes":[] },
|
||||
{"name":"scannableSafetyNumber","parameterTypes":[] },
|
||||
{"name":"trustLevel","parameterTypes":[] },
|
||||
{"name":"uuid","parameterTypes":[] }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"org.asamk.signal.commands.ListStickerPacksCommand$JsonStickerPack",
|
||||
|
|
|
@ -94,10 +94,8 @@ public class IdentityHelper {
|
|||
private boolean trustIdentity(
|
||||
RecipientId recipientId, BiFunction<ServiceId, IdentityKey, Boolean> verifier, TrustLevel trustLevel
|
||||
) {
|
||||
final var serviceId = account.getRecipientAddressResolver()
|
||||
.resolveRecipientAddress(recipientId)
|
||||
.serviceId()
|
||||
.orElse(null);
|
||||
final var address = account.getRecipientAddressResolver().resolveRecipientAddress(recipientId);
|
||||
final var serviceId = address.serviceId().orElse(null);
|
||||
if (serviceId == null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -112,9 +110,8 @@ public class IdentityHelper {
|
|||
|
||||
account.getIdentityKeyStore().setIdentityTrustLevel(serviceId, identity.getIdentityKey(), trustLevel);
|
||||
try {
|
||||
final var address = context.getRecipientHelper()
|
||||
.resolveSignalServiceAddress(account.getRecipientResolver().resolveRecipient(serviceId));
|
||||
context.getSyncHelper().sendVerifiedMessage(address, identity.getIdentityKey(), trustLevel);
|
||||
context.getSyncHelper()
|
||||
.sendVerifiedMessage(address.toSignalServiceAddress(), identity.getIdentityKey(), trustLevel);
|
||||
} catch (IOException e) {
|
||||
logger.warn("Failed to send verification sync message: {}", e.getMessage());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue