@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) List<JsonTextStyle> textStyles,
+ @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();
.map(JsonAttachment::from)
.toList() : null;
final var sticker = dataMessage.sticker().isPresent() ? JsonSticker.from(dataMessage.sticker().get()) : null;
-
final var contacts = dataMessage.sharedContacts().size() > 0 ? dataMessage.sharedContacts()
.stream()
.map(JsonSharedContact::from)
.toList() : null;
+ final var textStyles = dataMessage.textStyles().size() > 0 ? dataMessage.textStyles()
+ .stream()
+ .map(JsonTextStyle::from)
+ .toList() : null;
+
return new JsonDataMessage(timestamp,
message,
expiresInSeconds,
sticker,
remoteDelete,
contacts,
- groupInfo);
+ textStyles,
+ groupInfo,
+ storyContext);
}
}