Don't send unneeded user from inlineKeyboardButtonTypeUser for bots.

This commit is contained in:
levlam 2022-08-05 14:39:00 +03:00
parent feafa4aacc
commit edaff2eba5
2 changed files with 5 additions and 5 deletions

View File

@ -24689,8 +24689,7 @@ tl_object_ptr<td_api::message> MessagesManager::get_message_object(DialogId dial
auto edit_date = m->hide_edit_date ? 0 : m->edit_date;
auto is_pinned = is_scheduled ? false : m->is_pinned;
auto has_timestamped_media = for_event_log || reply_to_message_id == 0 || m->max_own_media_timestamp >= 0;
auto reply_markup =
get_reply_markup_object(m->message_id.is_any_server() ? td_->contacts_manager_.get() : nullptr, m->reply_markup);
auto reply_markup = get_reply_markup_object(td_->contacts_manager_.get(), m->reply_markup);
auto live_location_date = m->is_failed_to_send ? 0 : m->date;
auto skip_bot_commands = for_event_log ? true : need_skip_bot_commands(dialog_id, m);

View File

@ -922,9 +922,10 @@ static tl_object_ptr<td_api::inlineKeyboardButton> get_inline_keyboard_button_ob
type = make_tl_object<td_api::inlineKeyboardButtonTypeCallbackWithPassword>(keyboard_button.data);
break;
case InlineKeyboardButton::Type::User: {
auto user_id = contacts_manager == nullptr ? keyboard_button.user_id.get()
: contacts_manager->get_user_id_object(
keyboard_button.user_id, "get_inline_keyboard_button_object");
bool need_user = contacts_manager != nullptr && !contacts_manager->is_user_bot(contacts_manager->get_my_id());
auto user_id =
need_user ? contacts_manager->get_user_id_object(keyboard_button.user_id, "get_inline_keyboard_button_object")
: keyboard_button.user_id.get();
type = make_tl_object<td_api::inlineKeyboardButtonTypeUser>(user_id);
break;
}