2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Fix inline via @bot click in additional windows

Fixes #24717.
This commit is contained in:
John Preston
2022-07-05 11:56:29 +04:00
parent 6d17226c7f
commit c01d9747e7
11 changed files with 273 additions and 285 deletions

View File

@@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "main/main_app_config.h"
#include "apiwrap.h"
#include "mainwidget.h"
#include "api/api_bot.h"
#include "api/api_text_entities.h"
#include "core/application.h"
#include "core/core_settings.h"
@@ -105,9 +106,13 @@ void CheckForSwitchInlineButton(not_null<HistoryItem*> item) {
for (const auto &button : row) {
using ButtonType = HistoryMessageMarkupButton::Type;
if (button.type == ButtonType::SwitchInline) {
Notify::switchInlineBotButtonReceived(
&item->history()->session(),
QString::fromUtf8(button.data));
const auto session = &item->history()->session();
const auto &windows = session->windows();
if (!windows.empty()) {
Api::SwitchInlineBotButtonReceived(
windows.front(),
QString::fromUtf8(button.data));
}
return;
}
}