mirror of
https://github.com/aljazceru/signal-cli.git
synced 2026-01-26 09:04:19 +01:00
Make fields in json classes final and omit unnecessary nulls when serializing
Fix sender in sync read messages
This commit is contained in:
@@ -1,25 +1,29 @@
|
||||
package org.asamk.signal.json;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceReceiptMessage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
class JsonReceiptMessage {
|
||||
|
||||
long when;
|
||||
boolean isDelivery;
|
||||
boolean isRead;
|
||||
List<Long> timestamps;
|
||||
@JsonProperty
|
||||
final long when;
|
||||
|
||||
@JsonProperty
|
||||
final boolean isDelivery;
|
||||
|
||||
@JsonProperty
|
||||
final boolean isRead;
|
||||
|
||||
@JsonProperty
|
||||
final List<Long> timestamps;
|
||||
|
||||
JsonReceiptMessage(SignalServiceReceiptMessage receiptMessage) {
|
||||
|
||||
this.when = receiptMessage.getWhen();
|
||||
if (receiptMessage.isDeliveryReceipt()) {
|
||||
this.isDelivery = true;
|
||||
}
|
||||
if (receiptMessage.isReadReceipt()) {
|
||||
this.isRead = true;
|
||||
}
|
||||
this.isDelivery = receiptMessage.isDeliveryReceipt();
|
||||
this.isRead = receiptMessage.isReadReceipt();
|
||||
this.timestamps = receiptMessage.getTimestamps();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user