forked from mirror/monocles_chat_clean
don't show 'cancel download', if file is not downloading
This commit is contained in:
parent
02f24aba26
commit
9ccc59b645
2 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue