From e87ad723d01e026444c28eeab70a5a65eec02b47 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 20 Oct 2018 21:42:17 +0200 Subject: offer either 'cancel download' or 'delete file' but not both --- src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/de/pixart/messenger/ui') diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 91cc911c3..295345855 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -1370,13 +1370,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(); Log.d(Config.LOGTAG, "Path = " + path); if (path == null || !path.startsWith("/") || path.contains(FileBackend.getConversationsDirectory("null"))) { -- cgit v1.2.3