diff --git a/Telegram/SourceFiles/api/api_common.h b/Telegram/SourceFiles/api/api_common.h index 6f5b15b35..e8cab1fdb 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 hideVia = false; }; enum class SendType { diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 5cb3e0c53..a9298bacf 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -4146,6 +4146,9 @@ void ApiWrap::sendInlineResult( if (silentPost) { sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_silent; } + if (bot && action.options.hideVia) { + sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_hide_via; + } if (action.options.scheduled) { flags |= MessageFlag::IsOrWasScheduled; sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_schedule_date; @@ -4171,7 +4174,7 @@ void ApiWrap::sendInlineResult( newId.msg, messageFromId, HistoryItem::NewMessageDate(action.options.scheduled), - bot ? peerToUser(bot->id) : 0, + bot && !action.options.hideVia ? 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 5933f1e85..b23c4b498 100644 --- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp @@ -442,6 +442,7 @@ void GifsListWidget::selectInlineResult( } forceSend |= base::IsCtrlPressed(); + options.hideVia = true; if (const auto photo = item->getPhoto()) { using Data::PhotoSize; const auto media = photo->activeMediaView();