aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-10-20 21:42:17 +0200
committerChristian Schneppe <christian@pix-art.de>2018-10-20 21:42:17 +0200
commite87ad723d01e026444c28eeab70a5a65eec02b47 (patch)
treef1bc1fd2c3a1877551ab0ff70bfc15511c39e2fd
parent6dc5387ed95833ccfe66c90a3f60cd19207a04fc (diff)
offer either 'cancel download' or 'delete file' but not both
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java7
1 files changed, 4 insertions, 3 deletions
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"))) {