From 7c5af89c89a70eb0dbe34ab63255571a5b9a9ed1 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 11 Oct 2018 04:33:12 +0200 Subject: [PATCH] offer either 'cancel download' or 'delete file' but not both fixes #3221 --- .../eu/siacs/conversations/ui/ConversationFragment.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index b37e57b45..e457fa6c0 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1148,13 +1148,14 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke downloadFile.setVisible(true); downloadFile.setTitle(activity.getString(R.string.download_x_file, UIHelper.getFileDescriptionString(activity, m))); } - boolean waitingOfferedSending = m.getStatus() == Message.STATUS_WAITING + final boolean waitingOfferedSending = m.getStatus() == Message.STATUS_WAITING || m.getStatus() == Message.STATUS_UNSEND || m.getStatus() == Message.STATUS_OFFERED; - if ((t != null && !deleted) || waitingOfferedSending && m.needsUploading()) { + final boolean cancelable = (t != null && !deleted) || waitingOfferedSending && m.needsUploading(); + if (cancelable) { cancelTransmission.setVisible(true); } - if (m.isFileOrImage() && !deleted) { + if (m.isFileOrImage() && !deleted && !cancelable) { String path = m.getRelativeFilePath(); if (path == null || !path.startsWith("/") || FileBackend.isInDirectoryThatShouldNotBeScanned(getActivity(), path)) { deleteFile.setVisible(true);