1 package org
.asamk
.signal
.json
;
3 import com
.fasterxml
.jackson
.annotation
.JsonProperty
;
5 import org
.asamk
.Signal
;
6 import org
.asamk
.signal
.manager
.Manager
;
7 import org
.whispersystems
.signalservice
.api
.messages
.multidevice
.SentTranscriptMessage
;
9 import static org
.asamk
.signal
.util
.Util
.getLegacyIdentifier
;
11 class JsonSyncDataMessage
extends JsonDataMessage
{
15 final String destination
;
18 final String destinationNumber
;
21 final String destinationUuid
;
23 JsonSyncDataMessage(SentTranscriptMessage transcriptMessage
, Manager m
) {
24 super(transcriptMessage
.getMessage(), m
);
26 if (transcriptMessage
.getDestination().isPresent()) {
27 final var address
= transcriptMessage
.getDestination().get();
28 this.destination
= getLegacyIdentifier(address
);
29 this.destinationNumber
= address
.getNumber().orNull();
30 this.destinationUuid
= address
.getUuid().toString();
32 this.destination
= null;
33 this.destinationNumber
= null;
34 this.destinationUuid
= null;
38 JsonSyncDataMessage(Signal
.SyncMessageReceived messageReceived
) {
39 super(messageReceived
);
40 this.destination
= messageReceived
.getDestination();
41 this.destinationNumber
= null;
42 this.destinationUuid
= null;