mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 11:00:38 +00:00
parent
0f701df91f
commit
b178c7c67a
8 changed files with 95 additions and 9 deletions
13
src/main/java/org/asamk/signal/json/JsonPreview.java
Normal file
13
src/main/java/org/asamk/signal/json/JsonPreview.java
Normal file
|
@ -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));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue