Add viewOnce boolean to json data message

This commit is contained in:
AsamK 2021-01-17 11:29:11 +01:00
parent 46a4c2c0d0
commit 5a2c4b8dfd

View file

@ -24,6 +24,10 @@ class JsonDataMessage {
@JsonProperty
final Integer expiresInSeconds;
@JsonProperty
@JsonInclude(JsonInclude.Include.NON_NULL)
final Boolean viewOnce;
@JsonProperty
@JsonInclude(JsonInclude.Include.NON_NULL)
final JsonReaction reaction;
@ -66,6 +70,7 @@ class JsonDataMessage {
}
this.message = dataMessage.getBody().orNull();
this.expiresInSeconds = dataMessage.getExpiresInSeconds();
this.viewOnce = dataMessage.isViewOnce();
this.reaction = dataMessage.getReaction().isPresent()
? new JsonReaction(dataMessage.getReaction().get(), m)
: null;
@ -96,6 +101,7 @@ class JsonDataMessage {
message = messageReceived.getMessage();
groupInfo = messageReceived.getGroupId().length > 0 ? new JsonGroupInfo(messageReceived.getGroupId()) : null;
expiresInSeconds = null;
viewOnce = null;
reaction = null; // TODO Replace these 4 with the proper commands
quote = null;
mentions = null;
@ -108,6 +114,7 @@ class JsonDataMessage {
message = messageReceived.getMessage();
groupInfo = messageReceived.getGroupId().length > 0 ? new JsonGroupInfo(messageReceived.getGroupId()) : null;
expiresInSeconds = null;
viewOnce = null;
reaction = null; // TODO Replace these 4 with the proper commands
quote = null;
mentions = null;