Rename getPrivateMessageLink to getMessageLink.

GitOrigin-RevId: ae6ec6b2bf9eb5926395bc2e1298b231e42d26c1
This commit is contained in:
levlam 2019-04-08 04:50:26 +03:00
parent de87ddb108
commit 48a15fb0d3
7 changed files with 15 additions and 15 deletions

View File

@ -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

Binary file not shown.

View File

@ -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<Unit> &&promise) {
string MessagesManager::get_message_link(FullMessageId full_message_id, Promise<Unit> &&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 {};

View File

@ -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<Unit> &&promise);
string get_message_link(FullMessageId full_message_id, Promise<Unit> &&promise);
Status delete_dialog_reply_markup(DialogId dialog_id, MessageId message_id) TD_WARN_UNUSED_RESULT;

View File

@ -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<Unit> &&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> td, uint64 request_id, int64 dialog_id, int64 message_id)
GetMessageLinkRequest(ActorShared<Td> 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) {

View File

@ -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);

View File

@ -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<td_api::getMessages>(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<td_api::getPublicMessageLink>(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<td_api::getPrivateMessageLink>(as_chat_id(chat_id), as_message_id(message_id)));
send_request(td_api::make_object<td_api::getMessageLink>(as_chat_id(chat_id), as_message_id(message_id)));
} else if (op == "gcmbd") {
string chat_id;
string date;