mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
parent
0b5a063b62
commit
e63f2fafb9
1 changed files with 10 additions and 2 deletions
|
@ -55,10 +55,11 @@ public class ListContactsCommand implements JsonRpcLocalCommand {
|
||||||
for (var r : recipients) {
|
for (var r : recipients) {
|
||||||
final var contact = r.getContact() == null ? Contact.newBuilder().build() : r.getContact();
|
final var contact = r.getContact() == null ? Contact.newBuilder().build() : r.getContact();
|
||||||
final var profile = r.getProfile() == null ? Profile.newBuilder().build() : r.getProfile();
|
final var profile = r.getProfile() == null ? Profile.newBuilder().build() : r.getProfile();
|
||||||
writer.println("Number: {} Name: {} Profile name: {} Blocked: {} Message expiration: {}",
|
writer.println("Number: {} Name: {} Profile name: {} Color: {} Blocked: {} Message expiration: {}",
|
||||||
r.getAddress().getLegacyIdentifier(),
|
r.getAddress().getLegacyIdentifier(),
|
||||||
contact.getName(),
|
contact.getName(),
|
||||||
profile.getDisplayName(),
|
profile.getDisplayName(),
|
||||||
|
contact.getColor(),
|
||||||
contact.isBlocked(),
|
contact.isBlocked(),
|
||||||
contact.getMessageExpirationTime() == 0
|
contact.getMessageExpirationTime() == 0
|
||||||
? "disabled"
|
? "disabled"
|
||||||
|
@ -72,6 +73,7 @@ public class ListContactsCommand implements JsonRpcLocalCommand {
|
||||||
return new JsonContact(address.number().orElse(null),
|
return new JsonContact(address.number().orElse(null),
|
||||||
address.uuid().map(UUID::toString).orElse(null),
|
address.uuid().map(UUID::toString).orElse(null),
|
||||||
contact.getName(),
|
contact.getName(),
|
||||||
|
contact.getColor(),
|
||||||
contact.isBlocked(),
|
contact.isBlocked(),
|
||||||
contact.getMessageExpirationTime(),
|
contact.getMessageExpirationTime(),
|
||||||
r.getProfile() == null
|
r.getProfile() == null
|
||||||
|
@ -92,7 +94,13 @@ public class ListContactsCommand implements JsonRpcLocalCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
private record JsonContact(
|
private record JsonContact(
|
||||||
String number, String uuid, String name, boolean isBlocked, int messageExpirationTime, JsonProfile profile
|
String number,
|
||||||
|
String uuid,
|
||||||
|
String name,
|
||||||
|
String color,
|
||||||
|
boolean isBlocked,
|
||||||
|
int messageExpirationTime,
|
||||||
|
JsonProfile profile
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private record JsonProfile(
|
private record JsonProfile(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue