Fix build with the new scheme.
This commit is contained in:
parent
c9bd0ab725
commit
ce7b6fe17a
|
@ -29,11 +29,17 @@ ChatBotCommands::Changed ChatBotCommands::update(
|
||||||
|
|
||||||
BotCommands BotCommandsFromTL(const MTPBotInfo &result) {
|
BotCommands BotCommandsFromTL(const MTPBotInfo &result) {
|
||||||
return result.match([](const MTPDbotInfo &data) {
|
return result.match([](const MTPDbotInfo &data) {
|
||||||
|
const auto userId = data.vuser_id()
|
||||||
|
? UserId(*data.vuser_id())
|
||||||
|
: UserId();
|
||||||
|
if (!data.vcommands()) {
|
||||||
|
return BotCommands{ .userId = userId };
|
||||||
|
}
|
||||||
auto commands = ranges::views::all(
|
auto commands = ranges::views::all(
|
||||||
data.vcommands().v
|
data.vcommands()->v
|
||||||
) | ranges::views::transform(BotCommandFromTL) | ranges::to_vector;
|
) | ranges::views::transform(BotCommandFromTL) | ranges::to_vector;
|
||||||
return BotCommands{
|
return BotCommands{
|
||||||
.userId = UserId(data.vuser_id().v),
|
.userId = userId,
|
||||||
.commands = std::move(commands),
|
.commands = std::move(commands),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -137,11 +137,13 @@ void UserData::setBotInfo(const MTPBotInfo &info) {
|
||||||
botInfo->text = Ui::Text::String(st::msgMinWidth);
|
botInfo->text = Ui::Text::String(st::msgMinWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto commands = ranges::views::all(
|
auto commands = d.vcommands()
|
||||||
d.vcommands().v
|
? ranges::views::all(
|
||||||
) | ranges::views::transform(
|
d.vcommands()->v
|
||||||
Data::BotCommandFromTL
|
) | ranges::views::transform(
|
||||||
) | ranges::to_vector;
|
Data::BotCommandFromTL
|
||||||
|
) | ranges::to_vector
|
||||||
|
: std::vector<Data::BotCommand>();
|
||||||
const auto changedCommands = !ranges::equal(
|
const auto changedCommands = !ranges::equal(
|
||||||
botInfo->commands,
|
botInfo->commands,
|
||||||
commands);
|
commands);
|
||||||
|
|
Loading…
Reference in New Issue