From 62696fbc67aca074fc75ba3476bfb725a6fdb48b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Fern=C3=A1ndez=20Vald=C3=A9s?= Date: Sun, 29 Sep 2019 09:03:12 -0400 Subject: [PATCH] Added JsonSyncDataMessage class with destination field. --- .../org/asamk/signal/JsonSyncDataMessage.java | 18 ++++++++++++++++++ .../java/org/asamk/signal/JsonSyncMessage.java | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/main/java/org/asamk/signal/JsonSyncDataMessage.java diff --git a/src/main/java/org/asamk/signal/JsonSyncDataMessage.java b/src/main/java/org/asamk/signal/JsonSyncDataMessage.java new file mode 100644 index 00000000..06c9b32f --- /dev/null +++ b/src/main/java/org/asamk/signal/JsonSyncDataMessage.java @@ -0,0 +1,18 @@ +package org.asamk.signal; + +import org.whispersystems.signalservice.api.messages.multidevice.SentTranscriptMessage; + +import java.util.ArrayList; +import java.util.List; + +class JsonSyncDataMessage extends JsonDataMessage { + + String destination; + + JsonSyncDataMessage(SentTranscriptMessage transcriptMessage) { + super(transcriptMessage.getMessage()); + if (transcriptMessage.getDestination().isPresent()) { + this.destination = transcriptMessage.getDestination().get(); + } + } +} diff --git a/src/main/java/org/asamk/signal/JsonSyncMessage.java b/src/main/java/org/asamk/signal/JsonSyncMessage.java index febf64a4..6b597c87 100644 --- a/src/main/java/org/asamk/signal/JsonSyncMessage.java +++ b/src/main/java/org/asamk/signal/JsonSyncMessage.java @@ -7,13 +7,13 @@ import java.util.List; class JsonSyncMessage { - JsonDataMessage sentMessage; + JsonSyncDataMessage sentMessage; List blockedNumbers; List readMessages; JsonSyncMessage(SignalServiceSyncMessage syncMessage) { if (syncMessage.getSent().isPresent()) { - this.sentMessage = new JsonDataMessage(syncMessage.getSent().get().getMessage()); + this.sentMessage = new JsonSyncDataMessage(syncMessage.getSent().get()); } if (syncMessage.getBlockedList().isPresent()) { this.blockedNumbers = syncMessage.getBlockedList().get().getNumbers();