From 9bbdccc11127a3ad3b89b7cd24a6db77b6315528 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 3 Jan 2019 16:34:55 +0400 Subject: [PATCH] Postpone sticker send from StickerSetBox. Fixes #5539. --- Telegram/SourceFiles/boxes/sticker_set_box.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/boxes/sticker_set_box.cpp b/Telegram/SourceFiles/boxes/sticker_set_box.cpp index 0fbe11f600..f9716bad6d 100644 --- a/Telegram/SourceFiles/boxes/sticker_set_box.cpp +++ b/Telegram/SourceFiles/boxes/sticker_set_box.cpp @@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "chat_helpers/stickers.h" #include "boxes/confirm_box.h" #include "apiwrap.h" +#include "application.h" #include "storage/localstorage.h" #include "dialogs/dialogs_layout.h" #include "styles/style_boxes.h" @@ -387,11 +388,12 @@ void StickerSetBox::Inner::mouseReleaseEvent(QMouseEvent *e) { _previewTimer.cancel(); const auto index = stickerFromGlobalPos(e->globalPos()); if (index >= 0 && index < _pack.size() && !isMasksSet()) { - if (const auto main = App::main()) { - if (main->onSendSticker(_pack[index])) { + const auto sticker = _pack[index]; + Core::App().postponeCall(crl::guard(App::main(), [=] { + if (App::main()->onSendSticker(sticker)) { Ui::hideSettingsAndLayer(); } - } + })); } } }