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
;
11 import static org
.asamk
.signal
.util
.Util
.getLegacyIdentifier
;
13 class JsonSyncDataMessage
extends JsonDataMessage
{
17 final String destination
;
20 final String destinationNumber
;
23 final String destinationUuid
;
25 JsonSyncDataMessage(SentTranscriptMessage transcriptMessage
, Manager m
) {
26 super(transcriptMessage
.getMessage(), m
);
28 if (transcriptMessage
.getDestination().isPresent()) {
29 final var address
= transcriptMessage
.getDestination().get();
30 this.destination
= getLegacyIdentifier(address
);
31 this.destinationNumber
= address
.getNumber().orNull();
32 this.destinationUuid
= address
.getUuid().transform(UUID
::toString
).orNull();
34 this.destination
= null;
35 this.destinationNumber
= null;
36 this.destinationUuid
= null;
40 JsonSyncDataMessage(Signal
.SyncMessageReceived messageReceived
) {
41 super(messageReceived
);
42 this.destination
= messageReceived
.getDestination();
43 this.destinationNumber
= null;
44 this.destinationUuid
= null;