[Improvement] Hide "via bot" if possible
This commit is contained in:
parent
d8846380ad
commit
0a4eebfa98
3 changed files with 6 additions and 1 deletions
|
|
@ -17,6 +17,7 @@ struct SendOptions {
|
|||
bool silent = false;
|
||||
bool handleSupportSwitch = false;
|
||||
bool removeWebPageId = false;
|
||||
bool hideVia = false;
|
||||
};
|
||||
|
||||
enum class SendType {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue