mirror of
https://github.com/PaiGramTeam/telegram-bot-api.git
synced 2024-11-21 14:38:23 +00:00
feat: modify local mode
This commit is contained in:
parent
6c418e4fa0
commit
3b06eeefe5
@ -8202,7 +8202,7 @@ td::string Client::get_local_file_path(td::Slice file_uri) {
|
|||||||
td_api::object_ptr<td_api::InputFile> Client::get_input_file(const Query *query, td::Slice field_name,
|
td_api::object_ptr<td_api::InputFile> Client::get_input_file(const Query *query, td::Slice field_name,
|
||||||
td::Slice file_id, bool force_file) const {
|
td::Slice file_id, bool force_file) const {
|
||||||
if (!file_id.empty()) {
|
if (!file_id.empty()) {
|
||||||
if (parameters_->local_mode_) {
|
if (parameters_->local_mode_ && false) {
|
||||||
td::Slice file_protocol{"file:/"};
|
td::Slice file_protocol{"file:/"};
|
||||||
if (td::begins_with(file_id, file_protocol)) {
|
if (td::begins_with(file_id, file_protocol)) {
|
||||||
return make_object<td_api::inputFileLocal>(get_local_file_path(file_id.substr(file_protocol.size())));
|
return make_object<td_api::inputFileLocal>(get_local_file_path(file_id.substr(file_protocol.size())));
|
||||||
@ -13518,7 +13518,7 @@ void Client::json_store_file(td::JsonObjectScope &object, const td_api::file *fi
|
|||||||
object("file_size", file->size_);
|
object("file_size", file->size_);
|
||||||
}
|
}
|
||||||
if (with_path && file->local_->is_downloading_completed_) {
|
if (with_path && file->local_->is_downloading_completed_) {
|
||||||
if (parameters_->local_mode_) {
|
if (parameters_->local_mode_ && false) {
|
||||||
if (td::check_utf8(file->local_->path_)) {
|
if (td::check_utf8(file->local_->path_)) {
|
||||||
object("file_path", file->local_->path_);
|
object("file_path", file->local_->path_);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user