mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-01 20:10:39 +00:00
Make fields in json classes final and omit unnecessary nulls when serializing
Fix sender in sync read messages
This commit is contained in:
parent
dd4225dcb1
commit
46a4c2c0d0
16 changed files with 374 additions and 150 deletions
|
@ -1,18 +1,23 @@
|
|||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import org.asamk.Signal;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.whispersystems.signalservice.api.messages.multidevice.SentTranscriptMessage;
|
||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
||||
|
||||
class JsonSyncDataMessage extends JsonDataMessage {
|
||||
|
||||
String destination;
|
||||
@JsonProperty
|
||||
final String destination;
|
||||
|
||||
JsonSyncDataMessage(SentTranscriptMessage transcriptMessage, Manager m) {
|
||||
super(transcriptMessage.getMessage(), m);
|
||||
if (transcriptMessage.getDestination().isPresent()) {
|
||||
this.destination = transcriptMessage.getDestination().get().getLegacyIdentifier();
|
||||
}
|
||||
|
||||
this.destination = transcriptMessage.getDestination()
|
||||
.transform(SignalServiceAddress::getLegacyIdentifier)
|
||||
.orNull();
|
||||
}
|
||||
|
||||
JsonSyncDataMessage(Signal.SyncMessageReceived messageReceived) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue