mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-18 22:54:20 +01:00
14 lines
450 B
Java
14 lines
450 B
Java
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));
|
|
}
|
|
}
|