Mark top_thread_message_id as const when possible.

This commit is contained in:
levlam 2024-01-31 01:52:02 +03:00
parent 2a81a11e61
commit f7bf5f268a
2 changed files with 19 additions and 16 deletions

View File

@ -23948,8 +23948,9 @@ class MessagesManager::SendMessageLogEvent {
};
Result<td_api::object_ptr<td_api::message>> MessagesManager::send_message(
DialogId dialog_id, MessageId top_thread_message_id, td_api::object_ptr<td_api::InputMessageReplyTo> &&reply_to,
tl_object_ptr<td_api::messageSendOptions> &&options, tl_object_ptr<td_api::ReplyMarkup> &&reply_markup,
DialogId dialog_id, const MessageId top_thread_message_id,
td_api::object_ptr<td_api::InputMessageReplyTo> &&reply_to, tl_object_ptr<td_api::messageSendOptions> &&options,
tl_object_ptr<td_api::ReplyMarkup> &&reply_markup,
tl_object_ptr<td_api::InputMessageContent> &&input_message_content) {
if (input_message_content == nullptr) {
return Status::Error(400, "Can't send message without content");
@ -24206,8 +24207,8 @@ int64 MessagesManager::generate_new_media_album_id() {
}
Result<td_api::object_ptr<td_api::messages>> MessagesManager::send_message_group(
DialogId dialog_id, MessageId top_thread_message_id, td_api::object_ptr<td_api::InputMessageReplyTo> &&reply_to,
tl_object_ptr<td_api::messageSendOptions> &&options,
DialogId dialog_id, const MessageId top_thread_message_id,
td_api::object_ptr<td_api::InputMessageReplyTo> &&reply_to, tl_object_ptr<td_api::messageSendOptions> &&options,
vector<tl_object_ptr<td_api::InputMessageContent>> &&input_message_contents) {
if (input_message_contents.size() > MAX_GROUPED_MESSAGES) {
return Status::Error(400, "Too many messages to send as an album");
@ -25104,8 +25105,9 @@ void MessagesManager::do_send_bot_start_message(UserId bot_user_id, DialogId dia
}
Result<td_api::object_ptr<td_api::message>> MessagesManager::send_inline_query_result_message(
DialogId dialog_id, MessageId top_thread_message_id, td_api::object_ptr<td_api::InputMessageReplyTo> &&reply_to,
tl_object_ptr<td_api::messageSendOptions> &&options, int64 query_id, const string &result_id, bool hide_via_bot) {
DialogId dialog_id, const MessageId top_thread_message_id,
td_api::object_ptr<td_api::InputMessageReplyTo> &&reply_to, tl_object_ptr<td_api::messageSendOptions> &&options,
int64 query_id, const string &result_id, bool hide_via_bot) {
Dialog *d = get_dialog_force(dialog_id, "send_inline_query_result_message");
if (d == nullptr) {
return Status::Error(400, "Chat not found");
@ -26656,8 +26658,8 @@ void MessagesManager::do_forward_messages(DialogId to_dialog_id, DialogId from_d
std::move(random_ids), schedule_date, get_erase_log_event_promise(log_event_id));
}
void MessagesManager::send_forward_message_query(int32 flags, DialogId to_dialog_id, MessageId top_thread_message_id,
DialogId from_dialog_id,
void MessagesManager::send_forward_message_query(int32 flags, DialogId to_dialog_id,
const MessageId top_thread_message_id, DialogId from_dialog_id,
tl_object_ptr<telegram_api::InputPeer> as_input_peer,
vector<MessageId> message_ids, vector<int64> random_ids,
int32 schedule_date, Promise<Unit> promise) {

View File

@ -411,22 +411,23 @@ class MessagesManager final : public Actor {
bool for_draft);
Result<td_api::object_ptr<td_api::message>> send_message(
DialogId dialog_id, MessageId top_thread_message_id, td_api::object_ptr<td_api::InputMessageReplyTo> &&reply_to,
tl_object_ptr<td_api::messageSendOptions> &&options, tl_object_ptr<td_api::ReplyMarkup> &&reply_markup,
DialogId dialog_id, const MessageId top_thread_message_id,
td_api::object_ptr<td_api::InputMessageReplyTo> &&reply_to, tl_object_ptr<td_api::messageSendOptions> &&options,
tl_object_ptr<td_api::ReplyMarkup> &&reply_markup,
tl_object_ptr<td_api::InputMessageContent> &&input_message_content) TD_WARN_UNUSED_RESULT;
Result<td_api::object_ptr<td_api::messages>> send_message_group(
DialogId dialog_id, MessageId top_thread_message_id, td_api::object_ptr<td_api::InputMessageReplyTo> &&reply_to,
tl_object_ptr<td_api::messageSendOptions> &&options,
DialogId dialog_id, const MessageId top_thread_message_id,
td_api::object_ptr<td_api::InputMessageReplyTo> &&reply_to, tl_object_ptr<td_api::messageSendOptions> &&options,
vector<tl_object_ptr<td_api::InputMessageContent>> &&input_message_contents) TD_WARN_UNUSED_RESULT;
Result<MessageId> send_bot_start_message(UserId bot_user_id, DialogId dialog_id,
const string &parameter) TD_WARN_UNUSED_RESULT;
Result<td_api::object_ptr<td_api::message>> send_inline_query_result_message(
DialogId dialog_id, MessageId top_thread_message_id, td_api::object_ptr<td_api::InputMessageReplyTo> &&reply_to,
tl_object_ptr<td_api::messageSendOptions> &&options, int64 query_id, const string &result_id,
bool hide_via_bot) TD_WARN_UNUSED_RESULT;
DialogId dialog_id, const MessageId top_thread_message_id,
td_api::object_ptr<td_api::InputMessageReplyTo> &&reply_to, tl_object_ptr<td_api::messageSendOptions> &&options,
int64 query_id, const string &result_id, bool hide_via_bot) TD_WARN_UNUSED_RESULT;
Result<td_api::object_ptr<td_api::messages>> forward_messages(
DialogId to_dialog_id, MessageId top_thread_message_id, DialogId from_dialog_id, vector<MessageId> message_ids,
@ -1760,7 +1761,7 @@ class MessagesManager final : public Actor {
const vector<MessageId> &message_ids, bool drop_author, bool drop_media_captions,
uint64 log_event_id);
void send_forward_message_query(int32 flags, DialogId to_dialog_id, MessageId top_thread_message_id,
void send_forward_message_query(int32 flags, DialogId to_dialog_id, const MessageId top_thread_message_id,
DialogId from_dialog_id, tl_object_ptr<telegram_api::InputPeer> as_input_peer,
vector<MessageId> message_ids, vector<int64> random_ids, int32 schedule_date,
Promise<Unit> promise);