Fix view-once sync and quote descriptions.

This commit is contained in:
Greyson Parrelli
2020-01-09 12:03:52 -05:00
parent e2a48d1714
commit fd7aa9ccfa
17 changed files with 87 additions and 38 deletions

View File

@@ -105,6 +105,10 @@ public abstract class Slide {
return false;
}
public boolean hasViewOnce() {
return false;
}
public @NonNull String getContentDescription() { return ""; }
public @NonNull Attachment asAttachment() {

View File

@@ -88,7 +88,7 @@ public class SlideDeck {
public boolean containsMediaSlide() {
for (Slide slide : slides) {
if (slide.hasImage() || slide.hasVideo() || slide.hasAudio() || slide.hasDocument() || slide.hasSticker()) {
if (slide.hasImage() || slide.hasVideo() || slide.hasAudio() || slide.hasDocument() || slide.hasSticker() || slide.hasViewOnce()) {
return true;
}
}

View File

@@ -0,0 +1,28 @@
package org.thoughtcrime.securesms.mms;
import android.content.Context;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.thoughtcrime.securesms.attachments.Attachment;
import org.thoughtcrime.securesms.util.MediaUtil;
/**
* Slide used for attachments with contentType {@link MediaUtil#VIEW_ONCE}.
* Attachments will only get this type *after* they've been viewed, or if they were synced from a
* linked device. Incoming unviewed messages will have the appropriate image/video contentType.
*/
public class ViewOnceSlide extends Slide {
public ViewOnceSlide(@NonNull Context context, @NonNull Attachment attachment) {
super(context, attachment);
}
@Override
public boolean hasViewOnce() {
return true;
}
}