2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Replaced use of raw MTP* bot commands with new transitional classes.

This commit is contained in:
23rd
2022-05-15 00:27:21 +03:00
committed by John Preston
parent 5f8608ed90
commit 13146e9c06
14 changed files with 136 additions and 145 deletions

View File

@@ -136,9 +136,17 @@ void UserData::setBotInfo(const MTPBotInfo &info) {
botInfo->description = desc;
botInfo->text = Ui::Text::String(st::msgMinWidth);
}
const auto changedCommands = Data::UpdateBotCommands(
auto commands = ranges::views::all(
d.vcommands().v
) | ranges::views::transform(
Data::BotCommandFromTL
) | ranges::to_vector;
const auto changedCommands = !ranges::equal(
botInfo->commands,
d.vcommands());
commands);
botInfo->commands = std::move(commands);
const auto changedButton = Data::ApplyBotMenuButton(
botInfo.get(),
d.vmenu_button());