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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user