Respect peer_types in the switch inline button.

Fixes #26274.
This commit is contained in:
John Preston
2023-05-24 19:36:58 +04:00
parent 8a99de16f6
commit 7877463468
7 changed files with 70 additions and 10 deletions
+7 -5
View File
@@ -279,11 +279,11 @@ void SendBotCallbackDataWithPassword(
bool SwitchInlineBotButtonReceived(
not_null<Window::SessionController*> controller,
const QString &query,
const QByteArray &queryWithPeerTypes,
UserData *samePeerBot,
MsgId samePeerReplyTo) {
return controller->content()->notify_switchInlineBotButtonReceived(
query,
QString::fromUtf8(queryWithPeerTypes),
samePeerBot,
samePeerReplyTo);
}
@@ -441,14 +441,14 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) {
if (samePeer) {
SwitchInlineBotButtonReceived(
controller,
QString::fromUtf8(button->data),
button->data,
bot,
item->id);
return true;
} else if (bot->isBot() && bot->botInfo->inlineReturnTo.key) {
const auto switched = SwitchInlineBotButtonReceived(
controller,
QString::fromUtf8(button->data));
button->data);
if (switched) {
return true;
}
@@ -466,7 +466,9 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) {
Window::ShowChooseRecipientBox(
controller,
chosen,
tr::lng_inline_switch_choose());
tr::lng_inline_switch_choose(),
nullptr,
button->peerTypes);
}
}
} break;