@JsonInclude(JsonInclude.Include.NON_NULL) JsonQuote quote,
@JsonInclude(JsonInclude.Include.NON_NULL) JsonPayment payment,
@JsonInclude(JsonInclude.Include.NON_NULL) List<JsonMention> mentions,
+ @JsonInclude(JsonInclude.Include.NON_NULL) List<JsonPreview> previews,
@JsonInclude(JsonInclude.Include.NON_NULL) List<JsonAttachment> attachments,
@JsonInclude(JsonInclude.Include.NON_NULL) JsonSticker sticker,
@JsonInclude(JsonInclude.Include.NON_NULL) JsonRemoteDelete remoteDelete,
@JsonInclude(JsonInclude.Include.NON_NULL) List<JsonSharedContact> contacts,
- @JsonInclude(JsonInclude.Include.NON_NULL) JsonGroupInfo groupInfo
+ @JsonInclude(JsonInclude.Include.NON_NULL) JsonGroupInfo groupInfo,
+ @JsonInclude(JsonInclude.Include.NON_NULL) JsonStoryContext storyContext
) {
static JsonDataMessage from(MessageEnvelope.Data dataMessage) {
final var timestamp = dataMessage.timestamp();
final var groupInfo = dataMessage.groupContext().isPresent() ? JsonGroupInfo.from(dataMessage.groupContext()
.get()) : null;
+ final var storyContext = dataMessage.storyContext().isPresent()
+ ? JsonStoryContext.from(dataMessage.storyContext().get())
+ : null;
final var message = dataMessage.body().orElse(null);
final var expiresInSeconds = dataMessage.expiresInSeconds();
final var viewOnce = dataMessage.isViewOnce();
.stream()
.map(JsonMention::from)
.toList() : null;
+ final var previews = dataMessage.previews().size() > 0 ? dataMessage.previews()
+ .stream()
+ .map(JsonPreview::from)
+ .toList() : null;
final var remoteDelete = dataMessage.remoteDeleteId().isPresent()
? new JsonRemoteDelete(dataMessage.remoteDeleteId().get())
: null;
quote,
payment,
mentions,
+ previews,
attachments,
sticker,
remoteDelete,
contacts,
- groupInfo);
+ groupInfo,
+ storyContext);
}
}