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();