From 48a15fb0d3c2a47a18530163de596cfab1fe84b1 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 8 Apr 2019 04:50:26 +0300 Subject: [PATCH] Rename getPrivateMessageLink to getMessageLink. GitOrigin-RevId: ae6ec6b2bf9eb5926395bc2e1298b231e42d26c1 --- td/generate/scheme/td_api.tl | 4 ++-- td/generate/scheme/td_api.tlo | Bin 150180 -> 150172 bytes td/telegram/MessagesManager.cpp | 6 +++--- td/telegram/MessagesManager.h | 2 +- td/telegram/Td.cpp | 10 +++++----- td/telegram/Td.h | 2 +- td/telegram/cli.cpp | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 354263659..556860fbb 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -2910,10 +2910,10 @@ removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = //@for_album Pass true if a link for a whole media album should be returned getPublicMessageLink chat_id:int53 message_id:int53 for_album:Bool = PublicMessageLink; -//@description Returns a private HTTPS link to a message. Available only for already sent messages in supergroups and channels. The link will work only for chat members +//@description Returns a private HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels. The link will work only for members of the chat //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message -getPrivateMessageLink chat_id:int53 message_id:int53 = HttpUrl; +getMessageLink chat_id:int53 message_id:int53 = HttpUrl; //@description Sends a message. Returns the sent message @chat_id Target chat @reply_to_message_id Identifier of the message to reply to or 0 diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index a827d477a1473a4611c2fc494e213d711a8def55..4ccab223f75c52f2b65541fef2e0667b1b2edea7 100644 GIT binary patch delta 53 zcmV-50LuTQl?j}c34pW#*zOZ1r8!X!XJvFvWpi_3XJt%jZfln>;Q=z2jr0LGx7h9h LXa%>#^a0>iSmYNw delta 60 zcmV-C0K@;Bl?kMk34pW#*zUJf?*V898Zy{ub`@u3bWn0>c42g7O=WX)VP|DbX>Mzm SF5v+)mmTi`H@Cd>0pL{+I2pG9 diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 07f7d7cb8..33ca3b282 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -12205,7 +12205,7 @@ void MessagesManager::on_get_public_message_link(FullMessageId full_message_id, public_message_links_[for_group][full_message_id] = {std::move(url), std::move(html)}; } -string MessagesManager::get_private_message_link(FullMessageId full_message_id, Promise &&promise) { +string MessagesManager::get_message_link(FullMessageId full_message_id, Promise &&promise) { auto dialog_id = full_message_id.get_dialog_id(); auto d = get_dialog_force(dialog_id); if (d == nullptr) { @@ -12218,12 +12218,12 @@ string MessagesManager::get_private_message_link(FullMessageId full_message_id, } if (dialog_id.get_type() != DialogType::Channel) { promise.set_error( - Status::Error(6, "Private message links are available only for messages in supergroups and channel chats")); + Status::Error(6, "Message links are available only for messages in supergroups and channel chats")); return {}; } auto message_id = full_message_id.get_message_id(); - auto message = get_message_force(d, message_id, "get_private_message_link"); + auto message = get_message_force(d, message_id, "get_message_link"); if (message == nullptr) { promise.set_error(Status::Error(6, "Message not found")); return {}; diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index f3cc1af7c..003fc63fc 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -494,7 +494,7 @@ class MessagesManager : public Actor { void on_get_public_message_link(FullMessageId full_message_id, bool for_group, string url, string html); - string get_private_message_link(FullMessageId full_message_id, Promise &&promise); + string get_message_link(FullMessageId full_message_id, Promise &&promise); Status delete_dialog_reply_markup(DialogId dialog_id, MessageId message_id) TD_WARN_UNUSED_RESULT; diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 07d1444c7..bd8b545db 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -1047,13 +1047,13 @@ class GetPublicMessageLinkRequest : public RequestActor<> { } }; -class GetPrivateMessageLinkRequest : public RequestActor<> { +class GetMessageLinkRequest : public RequestActor<> { FullMessageId full_message_id_; string link_; void do_run(Promise &&promise) override { - link_ = td->messages_manager_->get_private_message_link(full_message_id_, std::move(promise)); + link_ = td->messages_manager_->get_message_link(full_message_id_, std::move(promise)); } void do_send_result() override { @@ -1061,7 +1061,7 @@ class GetPrivateMessageLinkRequest : public RequestActor<> { } public: - GetPrivateMessageLinkRequest(ActorShared td, uint64 request_id, int64 dialog_id, int64 message_id) + GetMessageLinkRequest(ActorShared td, uint64 request_id, int64 dialog_id, int64 message_id) : RequestActor(std::move(td), request_id), full_message_id_(DialogId(dialog_id), MessageId(message_id)) { } }; @@ -4933,9 +4933,9 @@ void Td::on_request(uint64 id, const td_api::getPublicMessageLink &request) { CREATE_REQUEST(GetPublicMessageLinkRequest, request.chat_id_, request.message_id_, request.for_album_); } -void Td::on_request(uint64 id, const td_api::getPrivateMessageLink &request) { +void Td::on_request(uint64 id, const td_api::getMessageLink &request) { CHECK_IS_USER(); - CREATE_REQUEST(GetPrivateMessageLinkRequest, request.chat_id_, request.message_id_); + CREATE_REQUEST(GetMessageLinkRequest, request.chat_id_, request.message_id_); } void Td::on_request(uint64 id, const td_api::getFile &request) { diff --git a/td/telegram/Td.h b/td/telegram/Td.h index fee34ff38..240d2f4ef 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -469,7 +469,7 @@ class Td final : public NetQueryCallback { void on_request(uint64 id, const td_api::getPublicMessageLink &request); - void on_request(uint64 id, const td_api::getPrivateMessageLink &request); + void on_request(uint64 id, const td_api::getMessageLink &request); void on_request(uint64 id, const td_api::getFile &request); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 14195695a..d46c1abaa 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -2330,7 +2330,7 @@ class CliClient final : public Actor { string message_ids; std::tie(chat_id, message_ids) = split(args); send_request(td_api::make_object(as_chat_id(chat_id), as_message_ids(message_ids))); - } else if (op == "gpuml") { + } else if (op == "gpml") { string chat_id; string message_id; string for_album; @@ -2338,11 +2338,11 @@ class CliClient final : public Actor { std::tie(message_id, for_album) = split(args); send_request(td_api::make_object(as_chat_id(chat_id), as_message_id(message_id), as_bool(for_album))); - } else if (op == "gprml") { + } else if (op == "gmlink") { string chat_id; string message_id; std::tie(chat_id, message_id) = split(args); - send_request(td_api::make_object(as_chat_id(chat_id), as_message_id(message_id))); + send_request(td_api::make_object(as_chat_id(chat_id), as_message_id(message_id))); } else if (op == "gcmbd") { string chat_id; string date;