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

Update bot menu attach in realtime.

This commit is contained in:
John Preston
2022-04-11 12:16:34 +04:00
parent c73eb5d791
commit be6ee73a04
4 changed files with 37 additions and 14 deletions

View File

@@ -133,20 +133,9 @@ void UserData::setBotInfo(const MTPBotInfo &info) {
const auto changedCommands = Data::UpdateBotCommands(
botInfo->commands,
d.vcommands());
auto text = QString();
auto url = QString();
d.vmenu_button().match([&](const MTPDbotMenuButton &data) {
text = qs(data.vtext());
url = qs(data.vurl());
}, [&](const auto &) {
});
const auto changedButton = (botInfo->botMenuButtonText != text)
|| (botInfo->botMenuButtonUrl != url);
if (changedButton) {
botInfo->botMenuButtonText = text;
botInfo->botMenuButtonUrl = url;
}
const auto changedButton = Data::ApplyBotMenuButton(
botInfo.get(),
d.vmenu_button());
botInfo->inited = true;
if (changedCommands || changedButton) {