Rename getPrivateMessageLink to getMessageLink.
GitOrigin-RevId: ae6ec6b2bf9eb5926395bc2e1298b231e42d26c1
This commit is contained in:
parent
de87ddb108
commit
48a15fb0d3
@ -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
|
//@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;
|
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
|
//@chat_id Identifier of the chat to which the message belongs
|
||||||
//@message_id Identifier of the message
|
//@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
|
//@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.
@ -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)};
|
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 dialog_id = full_message_id.get_dialog_id();
|
||||||
auto d = get_dialog_force(dialog_id);
|
auto d = get_dialog_force(dialog_id);
|
||||||
if (d == nullptr) {
|
if (d == nullptr) {
|
||||||
@ -12218,12 +12218,12 @@ string MessagesManager::get_private_message_link(FullMessageId full_message_id,
|
|||||||
}
|
}
|
||||||
if (dialog_id.get_type() != DialogType::Channel) {
|
if (dialog_id.get_type() != DialogType::Channel) {
|
||||||
promise.set_error(
|
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 {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
auto message_id = full_message_id.get_message_id();
|
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) {
|
if (message == nullptr) {
|
||||||
promise.set_error(Status::Error(6, "Message not found"));
|
promise.set_error(Status::Error(6, "Message not found"));
|
||||||
return {};
|
return {};
|
||||||
|
@ -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);
|
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;
|
Status delete_dialog_reply_markup(DialogId dialog_id, MessageId message_id) TD_WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
|
@ -1047,13 +1047,13 @@ class GetPublicMessageLinkRequest : public RequestActor<> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class GetPrivateMessageLinkRequest : public RequestActor<> {
|
class GetMessageLinkRequest : public RequestActor<> {
|
||||||
FullMessageId full_message_id_;
|
FullMessageId full_message_id_;
|
||||||
|
|
||||||
string link_;
|
string link_;
|
||||||
|
|
||||||
void do_run(Promise<Unit> &&promise) override {
|
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 {
|
void do_send_result() override {
|
||||||
@ -1061,7 +1061,7 @@ class GetPrivateMessageLinkRequest : public RequestActor<> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
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)) {
|
: 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_);
|
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();
|
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) {
|
void Td::on_request(uint64 id, const td_api::getFile &request) {
|
||||||
|
@ -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::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);
|
void on_request(uint64 id, const td_api::getFile &request);
|
||||||
|
|
||||||
|
@ -2330,7 +2330,7 @@ class CliClient final : public Actor {
|
|||||||
string message_ids;
|
string message_ids;
|
||||||
std::tie(chat_id, message_ids) = split(args);
|
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)));
|
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 chat_id;
|
||||||
string message_id;
|
string message_id;
|
||||||
string for_album;
|
string for_album;
|
||||||
@ -2338,11 +2338,11 @@ class CliClient final : public Actor {
|
|||||||
std::tie(message_id, for_album) = split(args);
|
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),
|
send_request(td_api::make_object<td_api::getPublicMessageLink>(as_chat_id(chat_id), as_message_id(message_id),
|
||||||
as_bool(for_album)));
|
as_bool(for_album)));
|
||||||
} else if (op == "gprml") {
|
} else if (op == "gmlink") {
|
||||||
string chat_id;
|
string chat_id;
|
||||||
string message_id;
|
string message_id;
|
||||||
std::tie(chat_id, message_id) = split(args);
|
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") {
|
} else if (op == "gcmbd") {
|
||||||
string chat_id;
|
string chat_id;
|
||||||
string date;
|
string date;
|
||||||
|
Reference in New Issue
Block a user