mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Improve identites listing
This commit is contained in:
parent
884fa2748e
commit
bc3bdbbf21
2 changed files with 11 additions and 2 deletions
|
@ -1147,7 +1147,12 @@ public class ManagerImpl implements Manager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Identity> getIdentities() {
|
public List<Identity> getIdentities() {
|
||||||
return account.getIdentityKeyStore().getIdentities().stream().map(this::toIdentity).toList();
|
return account.getIdentityKeyStore()
|
||||||
|
.getIdentities()
|
||||||
|
.stream()
|
||||||
|
.map(this::toIdentity)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Identity toIdentity(final IdentityInfo identityInfo) {
|
private Identity toIdentity(final IdentityInfo identityInfo) {
|
||||||
|
@ -1157,6 +1162,10 @@ public class ManagerImpl implements Manager {
|
||||||
|
|
||||||
final var address = account.getRecipientAddressResolver()
|
final var address = account.getRecipientAddressResolver()
|
||||||
.resolveRecipientAddress(account.getRecipientResolver().resolveRecipient(identityInfo.getServiceId()));
|
.resolveRecipientAddress(account.getRecipientResolver().resolveRecipient(identityInfo.getServiceId()));
|
||||||
|
if (address.serviceId().isPresent() && !Objects.equals(address.serviceId().get(),
|
||||||
|
identityInfo.getServiceId())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
final var scannableFingerprint = context.getIdentityHelper()
|
final var scannableFingerprint = context.getIdentityHelper()
|
||||||
.computeSafetyNumberForScanning(identityInfo.getServiceId(), identityInfo.getIdentityKey());
|
.computeSafetyNumberForScanning(identityInfo.getServiceId(), identityInfo.getIdentityKey());
|
||||||
return new Identity(address.toApiRecipientAddress(),
|
return new Identity(address.toApiRecipientAddress(),
|
||||||
|
|
|
@ -1032,7 +1032,7 @@ public class DbusSignalImpl implements Signal {
|
||||||
connection.exportObject(object);
|
connection.exportObject(object);
|
||||||
logger.debug("Exported dbus object: " + object.getObjectPath());
|
logger.debug("Exported dbus object: " + object.getObjectPath());
|
||||||
} catch (DBusException e) {
|
} catch (DBusException e) {
|
||||||
e.printStackTrace();
|
logger.warn("Failed to export dbus object (" + object.getObjectPath() + "): " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue