From ebedcc056b0093b0764b3cc8055d6529c150dcd6 Mon Sep 17 00:00:00 2001 From: SMAZNet Date: Sat, 20 Feb 2021 00:35:30 +0330 Subject: [PATCH] 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_ --- telegram-bot-api/Client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 774320b..86ca45d 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -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); } }