mirror of https://github.com/procxx/kepka.git
Fix file reference updating.
This commit is contained in:
parent
aa8f62da9d
commit
3f49796c43
|
@ -762,7 +762,9 @@ void mtpFileLoader::makeRequest(int offset) {
|
||||||
MTP_int(offset),
|
MTP_int(offset),
|
||||||
MTP_int(limit)),
|
MTP_int(limit)),
|
||||||
rpcDone(&mtpFileLoader::normalPartLoaded),
|
rpcDone(&mtpFileLoader::normalPartLoaded),
|
||||||
rpcFail(&mtpFileLoader::partFailed),
|
rpcFail(
|
||||||
|
&mtpFileLoader::normalPartFailed,
|
||||||
|
computeFileReference()),
|
||||||
shiftedDcId,
|
shiftedDcId,
|
||||||
50);
|
50);
|
||||||
}
|
}
|
||||||
|
@ -785,6 +787,15 @@ MTPInputFileLocation mtpFileLoader::computeLocation() const {
|
||||||
MTP_string(QString()));
|
MTP_string(QString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QByteArray mtpFileLoader::computeFileReference() const {
|
||||||
|
if (_location) {
|
||||||
|
return _location->fileReference();
|
||||||
|
} else if (_locationType == SecureFileLocation) {
|
||||||
|
return QByteArray();
|
||||||
|
}
|
||||||
|
return _fileReference;
|
||||||
|
}
|
||||||
|
|
||||||
void mtpFileLoader::requestMoreCdnFileHashes() {
|
void mtpFileLoader::requestMoreCdnFileHashes() {
|
||||||
Expects(!_finished);
|
Expects(!_finished);
|
||||||
|
|
||||||
|
@ -1076,7 +1087,8 @@ void mtpFileLoader::partLoaded(int offset, bytes::const_span buffer) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mtpFileLoader::partFailed(
|
bool mtpFileLoader::normalPartFailed(
|
||||||
|
QByteArray fileReference,
|
||||||
const RPCError &error,
|
const RPCError &error,
|
||||||
mtpRequestId requestId) {
|
mtpRequestId requestId) {
|
||||||
if (MTP::isDefaultHandledError(error)) {
|
if (MTP::isDefaultHandledError(error)) {
|
||||||
|
@ -1088,9 +1100,19 @@ bool mtpFileLoader::partFailed(
|
||||||
_origin,
|
_origin,
|
||||||
this,
|
this,
|
||||||
requestId,
|
requestId,
|
||||||
_location ? _location->fileReference() : _fileReference);
|
fileReference);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return partFailed(error, requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool mtpFileLoader::partFailed(
|
||||||
|
const RPCError &error,
|
||||||
|
mtpRequestId requestId) {
|
||||||
|
if (MTP::isDefaultHandledError(error)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
cancel(true);
|
cancel(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,7 +273,8 @@ private:
|
||||||
RequestData prepareRequest(int offset) const;
|
RequestData prepareRequest(int offset) const;
|
||||||
void makeRequest(int offset);
|
void makeRequest(int offset);
|
||||||
|
|
||||||
MTPInputFileLocation computeLocation() const;
|
[[nodiscard]] MTPInputFileLocation computeLocation() const;
|
||||||
|
[[nodiscard]] QByteArray computeFileReference() const;
|
||||||
bool loadPart() override;
|
bool loadPart() override;
|
||||||
void normalPartLoaded(const MTPupload_File &result, mtpRequestId requestId);
|
void normalPartLoaded(const MTPupload_File &result, mtpRequestId requestId);
|
||||||
void webPartLoaded(const MTPupload_WebFile &result, mtpRequestId requestId);
|
void webPartLoaded(const MTPupload_WebFile &result, mtpRequestId requestId);
|
||||||
|
@ -286,6 +287,7 @@ private:
|
||||||
void partLoaded(int offset, bytes::const_span buffer);
|
void partLoaded(int offset, bytes::const_span buffer);
|
||||||
|
|
||||||
bool partFailed(const RPCError &error, mtpRequestId requestId);
|
bool partFailed(const RPCError &error, mtpRequestId requestId);
|
||||||
|
bool normalPartFailed(QByteArray fileReference, const RPCError &error, mtpRequestId requestId);
|
||||||
bool cdnPartFailed(const RPCError &error, mtpRequestId requestId);
|
bool cdnPartFailed(const RPCError &error, mtpRequestId requestId);
|
||||||
|
|
||||||
void placeSentRequest(mtpRequestId requestId, const RequestData &requestData);
|
void placeSentRequest(mtpRequestId requestId, const RequestData &requestData);
|
||||||
|
|
Loading…
Reference in New Issue