Skip to content

Commit

Permalink
Remove duplicate address resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
AsamK committed Jun 3, 2023
1 parent 106af6a commit c62a1e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 10 additions & 1 deletion graalvm-config-dir/reflect-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ private Fingerprint computeSafetyNumberFingerprint(
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;
}
Expand All @@ -112,9 +110,8 @@ private boolean trustIdentity(

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());
}
Expand Down

0 comments on commit c62a1e8

Please sign in to comment.