diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 35426365..556860fb 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 a827d477..4ccab223 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 07f7d7cb..33ca3b28 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 f3cc1af7..003fc63f 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 07d1444c..bd8b545d 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 fee34ff3..240d2f4e 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 14195695..d46c1aba 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;