diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index cd9e26263..c7b346e0a 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -144,6 +144,7 @@ import static eu.siacs.conversations.ui.XmppActivity.EXTRA_ACCOUNT; import static eu.siacs.conversations.ui.XmppActivity.REQUEST_INVITE_TO_CONVERSATION; import static eu.siacs.conversations.ui.util.SoftKeyboardUtils.hideSoftKeyboard; import static eu.siacs.conversations.utils.Compatibility.runsTwentyOne; +import static eu.siacs.conversations.utils.MessageUtils.fileWithKnownSize; import static eu.siacs.conversations.utils.PermissionUtils.allGranted; import static eu.siacs.conversations.utils.PermissionUtils.getFirstDenied; import static eu.siacs.conversations.utils.PermissionUtils.readGranted; @@ -1358,6 +1359,9 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke if (cancelable) { cancelTransmission.setVisible(true); } + if (fileWithKnownSize(m)) { + cancelTransmission.setVisible(false); + } if (m.isFileOrImage() && !deleted && !cancelable) { String path = m.getRelativeFilePath(); Log.d(Config.LOGTAG, "Path = " + path); diff --git a/src/main/java/eu/siacs/conversations/utils/MessageUtils.java b/src/main/java/eu/siacs/conversations/utils/MessageUtils.java index 9565fcc11..ff0a978f9 100644 --- a/src/main/java/eu/siacs/conversations/utils/MessageUtils.java +++ b/src/main/java/eu/siacs/conversations/utils/MessageUtils.java @@ -112,4 +112,8 @@ public class MessageUtils { public static boolean unInitiatedButKnownSize(Message message) { return message.getType() == Message.TYPE_TEXT && message.getTransferable() == null && message.isOOb() && message.getFileParams().size > 0 && message.getFileParams().url != null; } + + public static boolean fileWithKnownSize(Message message) { + return message.getType() == Message.TYPE_TEXT && message.isOOb() && message.getFileParams().size > 0 && message.getFileParams().url != null; + } } \ No newline at end of file