mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Convert RecipientAddress to record
This commit is contained in:
parent
c3a9022bec
commit
8867a7b9ee
14 changed files with 59 additions and 91 deletions
|
@ -43,8 +43,8 @@ public class ListContactsCommand implements JsonRpcLocalCommand {
|
|||
final var jsonContacts = contacts.stream().map(contactPair -> {
|
||||
final var address = contactPair.first();
|
||||
final var contact = contactPair.second();
|
||||
return new JsonContact(address.getNumber().orElse(null),
|
||||
address.getUuid().map(UUID::toString).orElse(null),
|
||||
return new JsonContact(address.number().orElse(null),
|
||||
address.uuid().map(UUID::toString).orElse(null),
|
||||
contact.getName(),
|
||||
contact.isBlocked(),
|
||||
contact.getMessageExpirationTime());
|
||||
|
|
|
@ -41,8 +41,8 @@ public class ListGroupsCommand implements JsonRpcLocalCommand {
|
|||
|
||||
private static Set<JsonGroupMember> resolveJsonMembers(Set<RecipientAddress> addresses) {
|
||||
return addresses.stream()
|
||||
.map(address -> new JsonGroupMember(address.getNumber().orElse(null),
|
||||
address.getUuid().map(UUID::toString).orElse(null)))
|
||||
.map(address -> new JsonGroupMember(address.number().orElse(null),
|
||||
address.uuid().map(UUID::toString).orElse(null)))
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public class ListIdentitiesCommand implements JsonRpcLocalCommand {
|
|||
|
||||
private static void printIdentityFingerprint(PlainTextWriter writer, Identity theirId) {
|
||||
writer.println("{}: {} Added: {} Fingerprint: {} Safety Number: {}",
|
||||
theirId.recipient().getNumber().orElse(null),
|
||||
theirId.recipient().number().orElse(null),
|
||||
theirId.trustLevel(),
|
||||
theirId.dateAdded(),
|
||||
Hex.toString(theirId.getFingerprint()),
|
||||
|
@ -67,8 +67,8 @@ public class ListIdentitiesCommand implements JsonRpcLocalCommand {
|
|||
final var address = id.recipient();
|
||||
var safetyNumber = Util.formatSafetyNumber(id.safetyNumber());
|
||||
var scannableSafetyNumber = id.scannableSafetyNumber();
|
||||
return new JsonIdentity(address.getNumber().orElse(null),
|
||||
address.getUuid().map(UUID::toString).orElse(null),
|
||||
return new JsonIdentity(address.number().orElse(null),
|
||||
address.uuid().map(UUID::toString).orElse(null),
|
||||
Hex.toString(id.getFingerprint()),
|
||||
safetyNumber,
|
||||
scannableSafetyNumber == null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue