Fix file_path doesnt exists on getFile method (#55)

* Fix file_path doesnt exists on getFile method

This PR fixes file_path doesnt exists on getFile method when localmode enabled and filesize is bigger than limit

* added check parameters_->no_file_limit_
This commit is contained in:
SMAZNet 2021-02-20 00:35:30 +03:30 committed by GitHub
parent de05b42272
commit ebedcc056b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9076,7 +9076,7 @@ void Client::json_store_file(td::JsonObjectScope &object, const td_api::file *fi
}
} else {
Slice relative_path = td::PathView::relative(file->local_->path_, absolute_dir_, true);
if (!relative_path.empty() && file->local_->downloaded_size_ <= MAX_DOWNLOAD_FILE_SIZE) {
if (!relative_path.empty() && (parameters_->local_mode_ || parameters_->no_file_limit_ || file->local_->downloaded_size_ <= MAX_DOWNLOAD_FILE_SIZE)) {
object("file_path", relative_path);
}
}