Hide "via" markup when using gif tab

This commit is contained in:
Ilya Fedin 2021-06-30 16:49:49 +04:00
parent 3cf6384bed
commit 7505a6c6fc
3 changed files with 8 additions and 2 deletions

View file

@ -16,6 +16,7 @@ struct SendOptions {
bool silent = false; bool silent = false;
bool handleSupportSwitch = false; bool handleSupportSwitch = false;
bool removeWebPageId = false; bool removeWebPageId = false;
bool hideVia = false;
}; };
enum class SendType { enum class SendType {

View file

@ -4862,7 +4862,11 @@ void ApiWrap::sendInlineResult(
sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_silent; sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_silent;
} }
if (bot) { if (bot) {
flags |= MTPDmessage::Flag::f_via_bot_id; if (action.options.hideVia) {
sendFlags |= MTPmessages_SendInlineBotResult::Flag::f_hide_via;
} else {
flags |= MTPDmessage::Flag::f_via_bot_id;
}
} }
if (action.options.scheduled) { if (action.options.scheduled) {
flags |= MTPDmessage::Flag::f_from_scheduled; flags |= MTPDmessage::Flag::f_from_scheduled;
@ -4885,7 +4889,7 @@ void ApiWrap::sendInlineResult(
newId.msg, newId.msg,
messageFromId, messageFromId,
MTP_int(HistoryItem::NewMessageDate(action.options.scheduled)), MTP_int(HistoryItem::NewMessageDate(action.options.scheduled)),
bot ? peerToUser(bot->id) : 0, bot && !action.options.hideVia ? peerToUser(bot->id) : 0,
action.replyTo, action.replyTo,
messagePostAuthor); messagePostAuthor);

View file

@ -449,6 +449,7 @@ void GifsListWidget::selectInlineResult(
forceSend |= (QGuiApplication::keyboardModifiers() forceSend |= (QGuiApplication::keyboardModifiers()
== Qt::ControlModifier); == Qt::ControlModifier);
options.hideVia = true;
auto item = _rows[row].items[column]; auto item = _rows[row].items[column];
if (const auto photo = item->getPhoto()) { if (const auto photo = item->getPhoto()) {
using Data::PhotoSize; using Data::PhotoSize;