2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +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

@@ -159,6 +159,25 @@ bool UpdateBotCommands(
return result;
}
bool ApplyBotMenuButton(
not_null<BotInfo*> info,
const MTPBotMenuButton &button) {
auto text = QString();
auto url = QString();
button.match([&](const MTPDbotMenuButton &data) {
text = qs(data.vtext());
url = qs(data.vurl());
}, [&](const auto &) {
});
const auto changed = (info->botMenuButtonText != text)
|| (info->botMenuButtonUrl != url);
info->botMenuButtonText = text;
info->botMenuButtonUrl = url;
return changed;
}
} // namespace Data
PeerClickHandler::PeerClickHandler(not_null<PeerData*> peer)