aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-04-20 20:47:32 +0200
committerChristian Schneppe <christian@pix-art.de>2017-04-20 20:47:32 +0200
commitd237ade908db44051628f40f92d31f48175fb331 (patch)
treed26291ed38a8bc0dd7e7cb5a5fb8ee67da804ca3 /src/main/java/de
parent92a874236dcd60ff9012cad92d2b283a4c678a31 (diff)
re-add redownload context menu entry for deleted files
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index 11e81bfc6..c218a940e 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -630,6 +630,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
MenuItem sendAgain = menu.findItem(R.id.send_again);
MenuItem copyUrl = menu.findItem(R.id.copy_url);
MenuItem cancelTransmission = menu.findItem(R.id.cancel_transmission);
+ MenuItem downloadFile = menu.findItem(R.id.download_file);
MenuItem deleteFile = menu.findItem(R.id.delete_file);
MenuItem showErrorMessage = menu.findItem(R.id.show_error_message);
if (!treatAsFile
@@ -667,6 +668,10 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|| (t != null && t instanceof HttpDownloadConnection)) {
copyUrl.setVisible(true);
}
+ if ((m.isFileOrImage() && t instanceof TransferablePlaceholder && m.hasFileOnRemoteHost())) {
+ downloadFile.setVisible(true);
+ downloadFile.setTitle(activity.getString(R.string.download_x_file, UIHelper.getFileDescriptionString(activity, m)));
+ }
boolean waitingOfferedSending = m.getStatus() == Message.STATUS_WAITING
|| m.getStatus() == Message.STATUS_UNSEND
|| m.getStatus() == Message.STATUS_OFFERED;
@@ -708,6 +713,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
case R.id.copy_url:
copyUrl(selectedMessage);
return true;
+ case R.id.download_file:
+ downloadFile(selectedMessage);
+ return true;
case R.id.cancel_transmission:
cancelTransmission(selectedMessage);
return true;
@@ -832,6 +840,10 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
}
+ private void downloadFile(Message message) {
+ activity.xmppConnectionService.getHttpConnectionManager().createNewDownloadConnection(message, true);
+ }
+
private void cancelTransmission(Message message) {
Transferable transferable = message.getTransferable();
if (transferable != null) {