diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 23d6b4e4c..2495f16a9 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -2073,6 +2073,21 @@ class CliClient final : public Actor { send_message(chat_id, make_tl_object(as_input_file_id(file_id), nullptr, 0, 0, 0, "")); + } else if (op == "sanurl") { + string chat_id; + string url; + std::tie(chat_id, url) = split(args); + + send_message(chat_id, + make_tl_object( + td_api::make_object(url, "#url#", 0), nullptr, 0, 0, 0, "")); + } else if (op == "sanurl2") { + string chat_id; + string url; + std::tie(chat_id, url) = split(args); + + send_message(chat_id, make_tl_object( + td_api::make_object(url), nullptr, 0, 0, 0, "")); } else if (op == "sau") { string chat_id; string audio_path; diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp index 31fdc05a0..b49b293a5 100644 --- a/td/telegram/files/FileManager.cpp +++ b/td/telegram/files/FileManager.cpp @@ -1801,6 +1801,7 @@ Result FileManager::check_input_file_id(FileType type, Result re if (!file_view.has_remote_location()) { // TODO why not return file_id here? We will dup it anyway + // But it will not be duped if has_input_media(), so for now we can't return main_file_id file_id = next_file_id(); get_file_id_info(file_id)->node_id_ = file_node_id; file_nodes_[file_node_id]->file_ids_.push_back(file_id);