mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-08-27 05:47:03 +00:00
17 lines
525 B
Java
17 lines
525 B
Java
package org.asamk.signal.json;
|
|
|
|
import io.micronaut.jsonschema.JsonSchema;
|
|
|
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
|
|
|
@JsonSchema(title = "Preview")
|
|
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));
|
|
}
|
|
}
|