Pass only chat type to get_reply_markup.

This commit is contained in:
levlam 2024-03-11 15:08:17 +03:00
parent 8770955522
commit 69dd255f3d
3 changed files with 3 additions and 4 deletions

View File

@ -26105,7 +26105,7 @@ bool MessagesManager::can_set_game_score(DialogId dialog_id, const Message *m) c
Result<unique_ptr<ReplyMarkup>> MessagesManager::get_dialog_reply_markup(
DialogId dialog_id, tl_object_ptr<td_api::ReplyMarkup> &&reply_markup) const {
return get_reply_markup(std::move(reply_markup), dialog_id, td_->auth_manager_->is_bot(),
return get_reply_markup(std::move(reply_markup), dialog_id.get_type(), td_->auth_manager_->is_bot(),
td_->dialog_manager_->is_anonymous_administrator(dialog_id, nullptr));
}

View File

@ -825,8 +825,7 @@ Result<unique_ptr<ReplyMarkup>> get_reply_markup(td_api::object_ptr<td_api::Repl
}
Result<unique_ptr<ReplyMarkup>> get_reply_markup(td_api::object_ptr<td_api::ReplyMarkup> &&reply_markup_ptr,
DialogId dialog_id, bool is_bot, bool is_anonymous) {
auto dialog_type = dialog_id.get_type();
DialogType dialog_type, bool is_bot, bool is_anonymous) {
bool only_inline_keyboard = is_anonymous;
bool request_buttons_allowed = dialog_type == DialogType::User;
bool switch_inline_buttons_allowed = !is_anonymous;

View File

@ -108,7 +108,7 @@ Result<unique_ptr<ReplyMarkup>> get_reply_markup(td_api::object_ptr<td_api::Repl
bool switch_inline_buttons_allowed);
Result<unique_ptr<ReplyMarkup>> get_reply_markup(td_api::object_ptr<td_api::ReplyMarkup> &&reply_markup_ptr,
DialogId dialog_id, bool is_bot, bool is_anonymous);
DialogType dialog_type, bool is_bot, bool is_anonymous);
unique_ptr<ReplyMarkup> dup_reply_markup(const unique_ptr<ReplyMarkup> &reply_markup);