X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/0f701df91f0c76059bd249ad2df0069ec9497061..b178c7c67aea7bf334cbf0d54a4666af0a65b5d9:/src/main/java/org/asamk/signal/json/JsonPreview.java diff --git a/src/main/java/org/asamk/signal/json/JsonPreview.java b/src/main/java/org/asamk/signal/json/JsonPreview.java new file mode 100644 index 00000000..c5e0d49e --- /dev/null +++ b/src/main/java/org/asamk/signal/json/JsonPreview.java @@ -0,0 +1,13 @@ +package org.asamk.signal.json; + +import org.asamk.signal.manager.api.MessageEnvelope; + +public record JsonPreview(String url, String title, String description, JsonAttachment image) { + + static JsonPreview from(MessageEnvelope.Data.Preview preview) { + return new JsonPreview(preview.url(), + preview.title(), + preview.description(), + preview.image().map(JsonAttachment::from).orElse(null)); + } +}