Make fields in json classes final and omit unnecessary nulls when serializing

Fix sender in sync read messages
This commit is contained in:
AsamK 2021-01-17 11:23:02 +01:00
parent dd4225dcb1
commit 46a4c2c0d0
16 changed files with 374 additions and 150 deletions

View file

@ -1,19 +1,25 @@
package org.asamk.signal.json;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage;
import java.util.Base64;
public class JsonSticker {
String packId;
String packKey;
int stickerId;
@JsonProperty
final String packId;
@JsonProperty
final String packKey;
@JsonProperty
final int stickerId;
public JsonSticker(SignalServiceDataMessage.Sticker sticker) {
this.packId = Base64.getEncoder().encodeToString(sticker.getPackId());
this.packKey = Base64.getEncoder().encodeToString(sticker.getPackKey());
this.stickerId = sticker.getStickerId();
// TODO also download sticker image ??
}
}