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.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 expected = file.getExpectedSize();
|
||||
|
||||
if (tryResume) {
|
||||
resumeSize = file.getSize();
|
||||
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());
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue