aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java21
1 files changed, 18 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 d6e3f49da..ff023997f 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -781,10 +781,25 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
}
- public void resendMessage(Message message) {
- if (message.getType() == Message.TYPE_FILE || message.getType() == Message.TYPE_IMAGE) {
+ public void resendMessage(final Message message) {
+ if (message.isFileOrImage()) {
DownloadableFile file = activity.xmppConnectionService.getFileBackend().getFile(message);
- if (!file.exists()) {
+ if (file.exists()) {
+ final Conversation conversation = message.getConversation();
+ final XmppConnection xmppConnection = conversation.getAccount().getXmppConnection();
+ if (!message.hasFileOnRemoteHost()
+ && xmppConnection != null
+ && !xmppConnection.getFeatures().httpUpload(message.getFileParams().size)) {
+ activity.selectPresence(conversation, new OnPresenceSelected() {
+ @Override
+ public void onPresenceSelected() {
+ message.setCounterpart(conversation.getNextCounterpart());
+ activity.xmppConnectionService.resendFailedMessages(message);
+ }
+ });
+ return;
+ }
+ } else {
Toast.makeText(activity, R.string.file_deleted, Toast.LENGTH_SHORT).show();
message.setTransferable(new TransferablePlaceholder(Transferable.STATUS_DELETED));
activity.updateConversationList();