fixed downloading of deleted files
This commit is contained in:
parent
a644b40c3e
commit
8ab4ca7138
|
@ -369,9 +369,10 @@ public class HttpDownloadConnection implements Transferable {
|
||||||
}
|
}
|
||||||
connection.setUseCaches(false);
|
connection.setUseCaches(false);
|
||||||
connection.setRequestProperty("User-Agent", mXmppConnectionService.getIqGenerator().getUserAgent());
|
connection.setRequestProperty("User-Agent", mXmppConnectionService.getIqGenerator().getUserAgent());
|
||||||
final boolean tryResume = file.exists() && file.getKey() == null && file.getSize() > 0;
|
final long expected = file.getExpectedSize();
|
||||||
|
final boolean tryResume = file.exists() && file.getKey() == null && file.getSize() > 0 && file.getSize() < expected;
|
||||||
long resumeSize = 0;
|
long resumeSize = 0;
|
||||||
long expected = file.getExpectedSize();
|
|
||||||
if (tryResume) {
|
if (tryResume) {
|
||||||
resumeSize = file.getSize();
|
resumeSize = file.getSize();
|
||||||
Log.d(Config.LOGTAG, "http download trying resume after" + resumeSize + " of " + expected);
|
Log.d(Config.LOGTAG, "http download trying resume after" + resumeSize + " of " + expected);
|
||||||
|
|
|
@ -1422,7 +1422,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
|
||||||
Log.d(Config.LOGTAG, "type: " + transferable.getClass().getName());
|
Log.d(Config.LOGTAG, "type: " + transferable.getClass().getName());
|
||||||
Toast.makeText(getActivity(), R.string.not_connected_try_again, Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), R.string.not_connected_try_again, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else if (message.treatAsDownloadable()) {
|
} else if (message.treatAsDownloadable() || message.hasFileOnRemoteHost()) {
|
||||||
createNewConnection(message);
|
createNewConnection(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue