Disable restore on open if auto-download is off.

This commit is contained in:
Clark
2024-05-30 09:07:16 -04:00
committed by Cody Henthorne
parent 17581a7a5e
commit ad9b1f05b4
2 changed files with 19 additions and 1 deletions

View File

@@ -48,6 +48,7 @@ import org.thoughtcrime.securesms.mms.SlideClickListener;
import org.thoughtcrime.securesms.mms.SlidesClickedListener;
import org.thoughtcrime.securesms.mms.VideoSlide;
import org.thoughtcrime.securesms.stories.StoryTextPostModel;
import org.thoughtcrime.securesms.util.AttachmentUtil;
import org.thoughtcrime.securesms.util.MediaUtil;
import org.thoughtcrime.securesms.util.Util;
import org.thoughtcrime.securesms.util.views.Stub;
@@ -370,7 +371,7 @@ public class ThumbnailView extends FrameLayout {
transferControlViewStub.get().setSlides(List.of(slide));
}
int transferState = TransferControlView.getTransferState(List.of(slide));
boolean isOffloadedImage = transferState == AttachmentTable.TRANSFER_RESTORE_OFFLOADED && MediaUtil.isImageType(slide.getContentType());
boolean isOffloadedImage = (transferState == AttachmentTable.TRANSFER_RESTORE_OFFLOADED && MediaUtil.isImageType(slide.getContentType())) && AttachmentUtil.isRestoreOnOpenPermitted(getContext(), slide.asAttachment());
if (!showControls ||
transferState == AttachmentTable.TRANSFER_PROGRESS_DONE ||