]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/json/JsonDataMessage.java
Add remote delete info to json output
[signal-cli] / src / main / java / org / asamk / signal / json / JsonDataMessage.java
index 4636d80896b27051e4cc4aa0c2937aea5c0b5ecc..1c927b402b02c41687f6456c48493193a33a72d0 100644 (file)
@@ -48,6 +48,10 @@ class JsonDataMessage {
     @JsonInclude(JsonInclude.Include.NON_NULL)
     final JsonSticker sticker;
 
     @JsonInclude(JsonInclude.Include.NON_NULL)
     final JsonSticker sticker;
 
+    @JsonProperty
+    @JsonInclude(JsonInclude.Include.NON_NULL)
+    final JsonRemoteDelete remoteDelete;
+
     @JsonProperty
     @JsonInclude(JsonInclude.Include.NON_NULL)
     final JsonGroupInfo groupInfo;
     @JsonProperty
     @JsonInclude(JsonInclude.Include.NON_NULL)
     final JsonGroupInfo groupInfo;
@@ -84,6 +88,8 @@ class JsonDataMessage {
         } else {
             this.mentions = List.of();
         }
         } else {
             this.mentions = List.of();
         }
+        remoteDelete = dataMessage.getRemoteDelete().isPresent() ? new JsonRemoteDelete(dataMessage.getRemoteDelete()
+                .get()) : null;
         if (dataMessage.getAttachments().isPresent()) {
             this.attachments = dataMessage.getAttachments()
                     .get()
         if (dataMessage.getAttachments().isPresent()) {
             this.attachments = dataMessage.getAttachments()
                     .get()
@@ -102,6 +108,7 @@ class JsonDataMessage {
         groupInfo = messageReceived.getGroupId().length > 0 ? new JsonGroupInfo(messageReceived.getGroupId()) : null;
         expiresInSeconds = null;
         viewOnce = null;
         groupInfo = messageReceived.getGroupId().length > 0 ? new JsonGroupInfo(messageReceived.getGroupId()) : null;
         expiresInSeconds = null;
         viewOnce = null;
+        remoteDelete = null;
         reaction = null;    // TODO Replace these 4 with the proper commands
         quote = null;
         mentions = null;
         reaction = null;    // TODO Replace these 4 with the proper commands
         quote = null;
         mentions = null;
@@ -115,6 +122,7 @@ class JsonDataMessage {
         groupInfo = messageReceived.getGroupId().length > 0 ? new JsonGroupInfo(messageReceived.getGroupId()) : null;
         expiresInSeconds = null;
         viewOnce = null;
         groupInfo = messageReceived.getGroupId().length > 0 ? new JsonGroupInfo(messageReceived.getGroupId()) : null;
         expiresInSeconds = null;
         viewOnce = null;
+        remoteDelete = null;
         reaction = null;    // TODO Replace these 4 with the proper commands
         quote = null;
         mentions = null;
         reaction = null;    // TODO Replace these 4 with the proper commands
         quote = null;
         mentions = null;