String authorUuid,
String text,
@JsonInclude(JsonInclude.Include.NON_NULL) List<JsonMention> mentions,
- List<JsonQuotedAttachment> attachments
+ List<JsonQuotedAttachment> attachments,
+ @JsonInclude(JsonInclude.Include.NON_NULL) List<JsonTextStyle> textStyles
) {
static JsonQuote from(MessageEnvelope.Data.Quote quote) {
final var authorUuid = address.uuid().map(UUID::toString).orElse(null);
final var text = quote.text().orElse(null);
- final var mentions = quote.mentions().size() > 0
+ final var mentions = !quote.mentions().isEmpty()
? quote.mentions().stream().map(JsonMention::from).toList()
: null;
- final var attachments = quote.attachments().size() > 0 ? quote.attachments()
+ final var attachments = !quote.attachments().isEmpty() ? quote.attachments()
.stream()
.map(JsonQuotedAttachment::from)
.toList() : List.<JsonQuotedAttachment>of();
- return new JsonQuote(id, author, authorNumber, authorUuid, text, mentions, attachments);
+ final var textStyles = !quote.textStyles().isEmpty() ? quote.textStyles()
+ .stream()
+ .map(JsonTextStyle::from)
+ .toList() : null;
+
+ return new JsonQuote(id, author, authorNumber, authorUuid, text, mentions, attachments, textStyles);
}
}