Implement dbus support for listIdentities

Fixes #195
This commit is contained in:
AsamK 2024-04-19 17:07:18 +02:00
parent e4c5144fbf
commit c1775913b9
8 changed files with 31 additions and 18 deletions

View file

@ -1,17 +1,10 @@
package org.asamk.signal.manager.api;
import org.signal.libsignal.protocol.IdentityKey;
public record Identity(
RecipientAddress recipient,
IdentityKey identityKey,
byte[] fingerprint,
String safetyNumber,
byte[] scannableSafetyNumber,
TrustLevel trustLevel,
long dateAddedTimestamp
) {
public byte[] getFingerprint() {
return identityKey.getPublicKey().serialize();
}
}
) {}

View file

@ -1366,7 +1366,7 @@ public class ManagerImpl implements Manager {
final var scannableFingerprint = context.getIdentityHelper()
.computeSafetyNumberForScanning(identityInfo.getServiceId(), identityInfo.getIdentityKey());
return new Identity(address.toApiRecipientAddress(),
identityInfo.getIdentityKey(),
identityInfo.getIdentityKey().getPublicKey().serialize(),
context.getIdentityHelper()
.computeSafetyNumber(identityInfo.getServiceId(), identityInfo.getIdentityKey()),
scannableFingerprint == null ? null : scannableFingerprint.getSerialized(),