do not offer share button when file hasnt been downloaded. fixes #3971

This commit is contained in:
Daniel Gultsch 2021-01-21 18:35:12 +01:00
parent e711b3d294
commit 3b43cb0bda
1 changed files with 4 additions and 2 deletions

View File

@ -1120,8 +1120,9 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
MenuItem cancelTransmission = menu.findItem(R.id.cancel_transmission);
MenuItem deleteFile = menu.findItem(R.id.delete_file);
MenuItem showErrorMessage = menu.findItem(R.id.show_error_message);
final boolean unInitiatedButKnownSize = MessageUtils.unInitiatedButKnownSize(m);
final boolean showError = m.getStatus() == Message.STATUS_SEND_FAILED && m.getErrorMessage() != null && !Message.ERROR_MESSAGE_CANCELLED.equals(m.getErrorMessage());
if (!m.isFileOrImage() && !encrypted && !m.isGeoUri() && !m.treatAsDownloadable()) {
if (!m.isFileOrImage() && !encrypted && !m.isGeoUri() && !m.treatAsDownloadable() && !unInitiatedButKnownSize && t == null) {
copyMessage.setVisible(true);
quoteMessage.setVisible(!showError && MessageUtils.prepareQuote(m).length() > 0);
String body = m.getMergedBody().toString();
@ -1142,7 +1143,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
&& m.getConversation() instanceof Conversation) {
correctMessage.setVisible(true);
}
if ((m.isFileOrImage() && !deleted && !receiving) || (m.getType() == Message.TYPE_TEXT && !m.treatAsDownloadable())) {
if ((m.isFileOrImage() && !deleted && !receiving) || (m.getType() == Message.TYPE_TEXT && !m.treatAsDownloadable()) && !unInitiatedButKnownSize && t == null) {
shareWith.setVisible(true);
}
if (m.getStatus() == Message.STATUS_SEND_FAILED) {
@ -1151,6 +1152,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
if (m.hasFileOnRemoteHost()
|| m.isGeoUri()
|| m.treatAsDownloadable()
|| unInitiatedButKnownSize
|| t instanceof HttpDownloadConnection) {
copyUrl.setVisible(true);
}