mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Fix view-once sync and quote descriptions.
This commit is contained in:
@@ -105,6 +105,10 @@ public abstract class Slide {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasViewOnce() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public @NonNull String getContentDescription() { return ""; }
|
||||
|
||||
public @NonNull Attachment asAttachment() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user