mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-25 17:47:47 +00:00
Add support for article dates in link previews.
This commit is contained in:

committed by
Alan Evans

parent
bfed03b7b5
commit
dd8b9ff8fb
@@ -629,6 +629,7 @@ public class SignalServiceMessageSender {
|
||||
DataMessage.Preview.Builder previewBuilder = DataMessage.Preview.newBuilder();
|
||||
previewBuilder.setTitle(preview.getTitle());
|
||||
previewBuilder.setDescription(preview.getDescription());
|
||||
previewBuilder.setDate(preview.getDate());
|
||||
previewBuilder.setUrl(preview.getUrl());
|
||||
|
||||
if (preview.getImage().isPresent()) {
|
||||
|
@@ -687,6 +687,7 @@ public final class SignalServiceContent {
|
||||
results.add(new SignalServiceDataMessage.Preview(preview.getUrl(),
|
||||
preview.getTitle(),
|
||||
preview.getDescription(),
|
||||
preview.getDate(),
|
||||
Optional.fromNullable(attachment)));
|
||||
}
|
||||
|
||||
|
@@ -413,12 +413,14 @@ public class SignalServiceDataMessage {
|
||||
private final String url;
|
||||
private final String title;
|
||||
private final String description;
|
||||
private final long date;
|
||||
private final Optional<SignalServiceAttachment> image;
|
||||
|
||||
public Preview(String url, String title, String description, Optional<SignalServiceAttachment> image) {
|
||||
public Preview(String url, String title, String description, long date, Optional<SignalServiceAttachment> image) {
|
||||
this.url = url;
|
||||
this.title = title;
|
||||
this.description = description;
|
||||
this.date = date;
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
@@ -434,6 +436,10 @@ public class SignalServiceDataMessage {
|
||||
return description;
|
||||
}
|
||||
|
||||
public long getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public Optional<SignalServiceAttachment> getImage() {
|
||||
return image;
|
||||
}
|
||||
|
@@ -207,6 +207,7 @@ message DataMessage {
|
||||
optional string title = 2;
|
||||
optional AttachmentPointer image = 3;
|
||||
optional string description = 4;
|
||||
optional uint64 date = 5;
|
||||
}
|
||||
|
||||
message Sticker {
|
||||
|
Reference in New Issue
Block a user