diff --git a/Telegram/SourceFiles/api/api_common.h b/Telegram/SourceFiles/api/api_common.h index 6f5b15b35f..6e2ab6e800 100644 --- a/Telegram/SourceFiles/api/api_common.h +++ b/Telegram/SourceFiles/api/api_common.h @@ -17,6 +17,7 @@ struct SendOptions { bool silent = false; bool handleSupportSwitch = false; bool removeWebPageId = false; + bool hideViaBot = false; }; enum class SendType { diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 5f176bf99a..1f579cc31d 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -3591,6 +3591,9 @@ void ApiWrap::sendInlineResult( flags |= MessageFlag::IsOrWasScheduled; sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_schedule_date; } + if (action.options.hideViaBot) { + sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_hide_via; + } const auto sendAs = action.options.sendAs; const auto messageFromId = sendAs @@ -3612,7 +3615,7 @@ void ApiWrap::sendInlineResult( newId.msg, messageFromId, HistoryItem::NewMessageDate(action.options.scheduled), - bot ? peerToUser(bot->id) : 0, + (bot && !action.options.hideViaBot) ? peerToUser(bot->id) : 0, action.replyTo, messagePostAuthor); diff --git a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp index 79d8cb4f40..ae171bbe12 100644 --- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp @@ -486,6 +486,7 @@ void GifsListWidget::selectInlineResult( } } else if (const auto inlineResult = item->getResult()) { if (inlineResult->onChoose(item)) { + options.hideViaBot = true; _inlineResultChosen.fire({ .result = inlineResult, .bot = _searchBot,