mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Added JsonSyncDataMessage class with destination field.
This commit is contained in:
parent
7e267f1ebb
commit
62696fbc67
2 changed files with 20 additions and 2 deletions
18
src/main/java/org/asamk/signal/JsonSyncDataMessage.java
Normal file
18
src/main/java/org/asamk/signal/JsonSyncDataMessage.java
Normal file
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,13 +7,13 @@ import java.util.List;
|
||||||
|
|
||||||
class JsonSyncMessage {
|
class JsonSyncMessage {
|
||||||
|
|
||||||
JsonDataMessage sentMessage;
|
JsonSyncDataMessage sentMessage;
|
||||||
List<String> blockedNumbers;
|
List<String> blockedNumbers;
|
||||||
List<ReadMessage> readMessages;
|
List<ReadMessage> readMessages;
|
||||||
|
|
||||||
JsonSyncMessage(SignalServiceSyncMessage syncMessage) {
|
JsonSyncMessage(SignalServiceSyncMessage syncMessage) {
|
||||||
if (syncMessage.getSent().isPresent()) {
|
if (syncMessage.getSent().isPresent()) {
|
||||||
this.sentMessage = new JsonDataMessage(syncMessage.getSent().get().getMessage());
|
this.sentMessage = new JsonSyncDataMessage(syncMessage.getSent().get());
|
||||||
}
|
}
|
||||||
if (syncMessage.getBlockedList().isPresent()) {
|
if (syncMessage.getBlockedList().isPresent()) {
|
||||||
this.blockedNumbers = syncMessage.getBlockedList().get().getNumbers();
|
this.blockedNumbers = syncMessage.getBlockedList().get().getNumbers();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue