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

Fix switch button in outgoing msgs with keyboards.

Inline bot results panel behaviour improved.
Sent and deleted from hard drive GIFs now auto-re-download.
This commit is contained in:
John Preston
2016-04-20 15:27:38 +03:00
parent 10bd2b680d
commit 5caceefc2c
4 changed files with 65 additions and 41 deletions

View File

@@ -88,8 +88,16 @@ void activateBotCommand(const HistoryItem *msg, int row, int col) {
} break;
case HistoryMessageReplyMarkup::Button::SwitchInline: {
if (MainWidget *m = App::main()) {
if (UserData *bot = msg->history()->peer->asUser()) {
if (auto m = App::main()) {
auto getMessageBot = [msg]() -> UserData* {
if (auto bot = msg->viaBot()) {
return bot;
} else if (auto bot = msg->history()->peer->asUser()) {
return bot;
}
return nullptr;
};
if (auto bot = getMessageBot()) {
auto tryFastSwitch = [bot, &button]() -> bool {
if (bot->botInfo && bot->botInfo->inlineReturnPeerId) {
if (Notify::switchInlineBotButtonReceived(QString::fromUtf8(button->data))) {