Don't output caption if it's empty

This commit is contained in:
AsamK 2022-10-21 16:22:09 +02:00
parent ae221e0447
commit e450f36e81

View file

@ -289,7 +289,7 @@ public record MessageEnvelope(
a.getSize().map(Integer::longValue), a.getSize().map(Integer::longValue),
a.getPreview(), a.getPreview(),
Optional.empty(), Optional.empty(),
a.getCaption(), a.getCaption().map(c -> c.isEmpty() ? null : c),
a.getWidth() == 0 ? Optional.empty() : Optional.of(a.getWidth()), a.getWidth() == 0 ? Optional.empty() : Optional.of(a.getWidth()),
a.getHeight() == 0 ? Optional.empty() : Optional.of(a.getHeight()), a.getHeight() == 0 ? Optional.empty() : Optional.of(a.getHeight()),
a.getVoiceNote(), a.getVoiceNote(),