2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Some bugfixes. Closed beta 9040127.

Crash fix when trying to reply to a bot message which hides the keyboard.
Counting button widths better (more padding, use exact width when avail).
Hiding inline bot results fixed when switched to emoji before hiding.
This commit is contained in:
John Preston
2016-04-11 00:59:07 +04:00
parent 460e2ec0ac
commit 418e06052c
11 changed files with 60 additions and 39 deletions

View File

@@ -87,7 +87,17 @@ namespace App {
case HistoryMessageReplyMarkup::Button::SwitchInline: {
if (MainWidget *m = App::main()) {
if (UserData *bot = msg->history()->peer->asUser()) {
m->inlineSwitchLayer('@' + bot->username + ' ' + QString::fromUtf8(button->data));
auto tryFastSwitch = [bot, &button]() -> bool {
if (bot->botInfo && bot->botInfo->inlineReturnPeerId) {
if (Notify::switchInlineBotButtonReceived(QString::fromUtf8(button->data))) {
return true;
}
}
return false;
};
if (!tryFastSwitch()) {
m->inlineSwitchLayer('@' + bot->username + ' ' + QString::fromUtf8(button->data));
}
}
}
} break;
@@ -280,10 +290,11 @@ namespace Notify {
}
}
void switchInlineBotButtonReceived(const QString &query) {
bool switchInlineBotButtonReceived(const QString &query) {
if (MainWidget *m = App::main()) {
m->notify_switchInlineBotButtonReceived(query);
return m->notify_switchInlineBotButtonReceived(query);
}
return false;
}
void migrateUpdated(PeerData *peer) {