]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java
Add aci,pni to API RecipientAddress
[signal-cli] / src / main / java / org / asamk / signal / dbus / DbusManagerImpl.java
index cd65be5105fd1ff78117f27b06ac52a3698bfe26..4573b861734a05bd1ac6570c0404b78393d18f41 100644 (file)
@@ -690,8 +690,11 @@ public class DbusManagerImpl implements Manager {
                 return null;
             }
             return Recipient.newBuilder()
-                    .withAddress(new RecipientAddress(null, n))
+                    .withAddress(new RecipientAddress(n))
                     .withContact(new Contact(contactName,
+                            null,
+                            null,
+                            null,
                             null,
                             null,
                             null,
@@ -728,19 +731,19 @@ public class DbusManagerImpl implements Manager {
                     (String) group.get("Description").getValue(),
                     GroupInviteLinkUrl.fromUri((String) group.get("GroupInviteLink").getValue()),
                     ((List<String>) group.get("Members").getValue()).stream()
-                            .map(m -> new RecipientAddress(null, m))
+                            .map(m -> new RecipientAddress(m))
                             .collect(Collectors.toSet()),
                     ((List<String>) group.get("PendingMembers").getValue()).stream()
-                            .map(m -> new RecipientAddress(null, m))
+                            .map(m -> new RecipientAddress(m))
                             .collect(Collectors.toSet()),
                     ((List<String>) group.get("RequestingMembers").getValue()).stream()
-                            .map(m -> new RecipientAddress(null, m))
+                            .map(m -> new RecipientAddress(m))
                             .collect(Collectors.toSet()),
                     ((List<String>) group.get("Admins").getValue()).stream()
-                            .map(m -> new RecipientAddress(null, m))
+                            .map(m -> new RecipientAddress(m))
                             .collect(Collectors.toSet()),
                     ((List<String>) group.get("Banned").getValue()).stream()
-                            .map(m -> new RecipientAddress(null, m))
+                            .map(m -> new RecipientAddress(m))
                             .collect(Collectors.toSet()),
                     (boolean) group.get("IsBlocked").getValue(),
                     (int) group.get("MessageExpirationTimer").getValue(),
@@ -851,8 +854,7 @@ public class DbusManagerImpl implements Manager {
         try {
             this.dbusMsgHandler = messageReceived -> {
                 final var extras = messageReceived.getExtras();
-                final var envelope = new MessageEnvelope(Optional.of(new RecipientAddress(null,
-                        messageReceived.getSender())),
+                final var envelope = new MessageEnvelope(Optional.of(new RecipientAddress(messageReceived.getSender())),
                         0,
                         messageReceived.getTimestamp(),
                         0,
@@ -893,8 +895,7 @@ public class DbusManagerImpl implements Manager {
             connection.addSigHandler(Signal.MessageReceivedV2.class, signal, this.dbusMsgHandler);
             this.dbusEditMsgHandler = messageReceived -> {
                 final var extras = messageReceived.getExtras();
-                final var envelope = new MessageEnvelope(Optional.of(new RecipientAddress(null,
-                        messageReceived.getSender())),
+                final var envelope = new MessageEnvelope(Optional.of(new RecipientAddress(messageReceived.getSender())),
                         0,
                         messageReceived.getTimestamp(),
                         0,
@@ -942,8 +943,7 @@ public class DbusManagerImpl implements Manager {
                     case "delivery" -> MessageEnvelope.Receipt.Type.DELIVERY;
                     default -> MessageEnvelope.Receipt.Type.UNKNOWN;
                 };
-                final var envelope = new MessageEnvelope(Optional.of(new RecipientAddress(null,
-                        receiptReceived.getSender())),
+                final var envelope = new MessageEnvelope(Optional.of(new RecipientAddress(receiptReceived.getSender())),
                         0,
                         receiptReceived.getTimestamp(),
                         0,
@@ -964,8 +964,7 @@ public class DbusManagerImpl implements Manager {
 
             this.dbusSyncHandler = syncReceived -> {
                 final var extras = syncReceived.getExtras();
-                final var envelope = new MessageEnvelope(Optional.of(new RecipientAddress(null,
-                        syncReceived.getSource())),
+                final var envelope = new MessageEnvelope(Optional.of(new RecipientAddress(syncReceived.getSource())),
                         0,
                         syncReceived.getTimestamp(),
                         0,
@@ -979,7 +978,7 @@ public class DbusManagerImpl implements Manager {
                                 syncReceived.getTimestamp(),
                                 syncReceived.getDestination().isEmpty()
                                         ? Optional.empty()
-                                        : Optional.of(new RecipientAddress(null, syncReceived.getDestination())),
+                                        : Optional.of(new RecipientAddress(syncReceived.getDestination())),
                                 Set.of(),
                                 Optional.of(new MessageEnvelope.Data(syncReceived.getTimestamp(),
                                         syncReceived.getGroupId().length > 0
@@ -1078,7 +1077,7 @@ public class DbusManagerImpl implements Manager {
 
         final List<DBusMap<String, Variant<?>>> mentions = getValue(extras, "mentions");
         return mentions.stream()
-                .map(a -> new MessageEnvelope.Data.Mention(new RecipientAddress(null, getValue(a, "recipient")),
+                .map(a -> new MessageEnvelope.Data.Mention(new RecipientAddress(this.<String>getValue(a, "recipient")),
                         getValue(a, "start"),
                         getValue(a, "length")))
                 .toList();