mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Add bot menu button with webview open support.
This commit is contained in:
@@ -133,10 +133,23 @@ 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;
|
||||
}
|
||||
|
||||
botInfo->inited = true;
|
||||
|
||||
if (changedCommands) {
|
||||
if (changedCommands || changedButton) {
|
||||
owner().botCommandsChanged(this);
|
||||
}
|
||||
} break;
|
||||
|
Reference in New Issue
Block a user