tg_cli: add sanurl commands.

GitOrigin-RevId: 44e9febc12a648b9360f85d8ac7a9b7fd784bb37
This commit is contained in:
levlam 2018-01-05 13:33:08 +03:00
parent 2312c5e1a6
commit d990fd21d2
2 changed files with 16 additions and 0 deletions

View File

@ -2073,6 +2073,21 @@ class CliClient final : public Actor {
send_message(chat_id, send_message(chat_id,
make_tl_object<td_api::inputMessageAnimation>(as_input_file_id(file_id), nullptr, 0, 0, 0, "")); make_tl_object<td_api::inputMessageAnimation>(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::inputMessageAnimation>(
td_api::make_object<td_api::inputFileGenerated>(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::inputMessageAnimation>(
td_api::make_object<td_api::inputFileRemote>(url), nullptr, 0, 0, 0, ""));
} else if (op == "sau") { } else if (op == "sau") {
string chat_id; string chat_id;
string audio_path; string audio_path;

View File

@ -1801,6 +1801,7 @@ Result<FileId> FileManager::check_input_file_id(FileType type, Result<FileId> re
if (!file_view.has_remote_location()) { if (!file_view.has_remote_location()) {
// TODO why not return file_id here? We will dup it anyway // 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(); file_id = next_file_id();
get_file_id_info(file_id)->node_id_ = file_node_id; get_file_id_info(file_id)->node_id_ = file_node_id;
file_nodes_[file_node_id]->file_ids_.push_back(file_id); file_nodes_[file_node_id]->file_ids_.push_back(file_id);