mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-25 17:47:47 +00:00
Add support for link preview descriptions.
This commit is contained in:
@@ -628,6 +628,7 @@ public class SignalServiceMessageSender {
|
||||
for (SignalServiceDataMessage.Preview preview : message.getPreviews().get()) {
|
||||
DataMessage.Preview.Builder previewBuilder = DataMessage.Preview.newBuilder();
|
||||
previewBuilder.setTitle(preview.getTitle());
|
||||
previewBuilder.setDescription(preview.getDescription());
|
||||
previewBuilder.setUrl(preview.getUrl());
|
||||
|
||||
if (preview.getImage().isPresent()) {
|
||||
|
@@ -685,8 +685,9 @@ public final class SignalServiceContent {
|
||||
}
|
||||
|
||||
results.add(new SignalServiceDataMessage.Preview(preview.getUrl(),
|
||||
preview.getTitle(),
|
||||
Optional.fromNullable(attachment)));
|
||||
preview.getTitle(),
|
||||
preview.getDescription(),
|
||||
Optional.fromNullable(attachment)));
|
||||
}
|
||||
|
||||
return results;
|
||||
|
@@ -412,12 +412,14 @@ public class SignalServiceDataMessage {
|
||||
public static class Preview {
|
||||
private final String url;
|
||||
private final String title;
|
||||
private final String description;
|
||||
private final Optional<SignalServiceAttachment> image;
|
||||
|
||||
public Preview(String url, String title, Optional<SignalServiceAttachment> image) {
|
||||
this.url = url;
|
||||
this.title = title;
|
||||
this.image = image;
|
||||
public Preview(String url, String title, String description, Optional<SignalServiceAttachment> image) {
|
||||
this.url = url;
|
||||
this.title = title;
|
||||
this.description = description;
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
@@ -428,6 +430,10 @@ public class SignalServiceDataMessage {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public Optional<SignalServiceAttachment> getImage() {
|
||||
return image;
|
||||
}
|
||||
|
@@ -203,9 +203,10 @@ message DataMessage {
|
||||
}
|
||||
|
||||
message Preview {
|
||||
optional string url = 1;
|
||||
optional string title = 2;
|
||||
optional AttachmentPointer image = 3;
|
||||
optional string url = 1;
|
||||
optional string title = 2;
|
||||
optional AttachmentPointer image = 3;
|
||||
optional string description = 4;
|
||||
}
|
||||
|
||||
message Sticker {
|
||||
|
Reference in New Issue
Block a user