Avoid opening Media preview for not sent media.

This commit is contained in:
Sagar
2025-04-18 00:48:35 +05:30
committed by Cody Henthorne
parent 1228da8665
commit d2f44fee87
3 changed files with 14 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ import org.thoughtcrime.securesms.components.menu.ActionItem;
import org.thoughtcrime.securesms.components.menu.SignalBottomActionBar;
import org.thoughtcrime.securesms.components.voice.VoiceNoteMediaController;
import org.thoughtcrime.securesms.components.voice.VoiceNotePlaybackState;
import org.thoughtcrime.securesms.database.AttachmentTable;
import org.thoughtcrime.securesms.database.MediaTable;
import org.thoughtcrime.securesms.database.loaders.GroupedThreadMediaLoader;
import org.thoughtcrime.securesms.database.loaders.MediaLoader;
@@ -252,6 +253,10 @@ public final class MediaOverviewPageFragment extends LoggingFragment
DatabaseAttachment attachment = mediaRecord.getAttachment();
if (MediaUtil.isVideo(attachment) || MediaUtil.isImage(attachment)) {
if (mediaRecord.getAttachment().transferState != AttachmentTable.TRANSFER_PROGRESS_DONE) {
Toast.makeText(context, R.string.MediaOverviewActivity_this_media_is_not_sent_yet, Toast.LENGTH_LONG).show();
return;
}
MediaIntentFactory.MediaPreviewArgs args = new MediaIntentFactory.MediaPreviewArgs(
threadId,
mediaRecord.getDate(),