mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-01 20:10:39 +00:00
Added destination field of sync messages to JSON output
This commit is contained in:
parent
9aa13e92fe
commit
4aa7185641
1 changed files with 7 additions and 1 deletions
|
@ -2,18 +2,24 @@ package org.asamk.signal;
|
|||
|
||||
import org.whispersystems.signalservice.api.messages.multidevice.ReadMessage;
|
||||
import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage;
|
||||
import org.whispersystems.signalservice.api.messages.multidevice.SentTranscriptMessage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
class JsonSyncMessage {
|
||||
|
||||
JsonDataMessage sentMessage;
|
||||
String destination;
|
||||
List<String> blockedNumbers;
|
||||
List<ReadMessage> readMessages;
|
||||
|
||||
JsonSyncMessage(SignalServiceSyncMessage syncMessage) {
|
||||
if (syncMessage.getSent().isPresent()) {
|
||||
this.sentMessage = new JsonDataMessage(syncMessage.getSent().get().getMessage());
|
||||
final SentTranscriptMessage sentTranscriptMessage = syncMessage.getSent().get();
|
||||
if (sentTranscriptMessage.getDestination().isPresent()) {
|
||||
this.destination = sentTranscriptMessage.getDestination().get();
|
||||
}
|
||||
this.sentMessage = new JsonDataMessage(sentTranscriptMessage.getMessage());
|
||||
}
|
||||
if (syncMessage.getBlockedList().isPresent()) {
|
||||
this.blockedNumbers = syncMessage.getBlockedList().get().getNumbers();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue