@JsonInclude(JsonInclude.Include.NON_NULL)
final JsonRemoteDelete remoteDelete;
+ @JsonProperty
+ @JsonInclude(JsonInclude.Include.NON_NULL)
+ final List<JsonSharedContact> contacts;
+
@JsonProperty
@JsonInclude(JsonInclude.Include.NON_NULL)
final JsonGroupInfo groupInfo;
this.attachments = List.of();
}
this.sticker = dataMessage.getSticker().isPresent() ? new JsonSticker(dataMessage.getSticker().get()) : null;
+
+ if (dataMessage.getSharedContacts().isPresent()) {
+ this.contacts = dataMessage.getSharedContacts()
+ .get()
+ .stream()
+ .map(JsonSharedContact::new)
+ .collect(Collectors.toList());
+ } else {
+ this.contacts = List.of();
+ }
}
public JsonDataMessage(Signal.MessageReceived messageReceived) {
expiresInSeconds = null;
viewOnce = null;
remoteDelete = null;
- reaction = null; // TODO Replace these 4 with the proper commands
+ reaction = null; // TODO Replace these 5 with the proper commands
quote = null;
mentions = null;
sticker = null;
+ contacts = null;
attachments = messageReceived.getAttachments().stream().map(JsonAttachment::new).collect(Collectors.toList());
}
expiresInSeconds = null;
viewOnce = null;
remoteDelete = null;
- reaction = null; // TODO Replace these 4 with the proper commands
+ reaction = null; // TODO Replace these 5 with the proper commands
quote = null;
mentions = null;
sticker = null;
+ contacts = null;
attachments = messageReceived.getAttachments().stream().map(JsonAttachment::new).collect(Collectors.toList());
}
}