From d4c0ac5e4aea38deafd1c171d5525b4db0ec7ee9 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 3 Sep 2021 12:17:40 +0300 Subject: [PATCH] Removed forwarding options for dices. --- .../SourceFiles/history/history_widget.cpp | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 981c1c4a2..476ac5504 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -5367,14 +5367,26 @@ void HistoryWidget::mousePressEvent(QMouseEvent *e) { for (const auto item : _toForward.items) { if (const auto media = item->media()) { if (!item->originalText().text.isEmpty() - && (media->photo() || media->document()) - && !media->webpage()) { + && media->allowsEditCaption()) { return true; } } } return false; }(); + const auto hasOnlyForcedForwardedInfo = [&] { + if (hasCaptions) { + return false; + } + for (const auto item : _toForward.items) { + if (const auto media = item->media()) { + if (!media->forceForwardedInfo()) { + return false; + } + } + } + return true; + }(); const auto dropCaptions = (now == Options::NoNamesAndCaptions); const auto weak = Ui::MakeWeak(this); const auto changeRecipient = crl::guard(weak, [=] { @@ -5389,6 +5401,10 @@ void HistoryWidget::mousePressEvent(QMouseEvent *e) { .options = draft.options, }); }); + if (hasOnlyForcedForwardedInfo) { + changeRecipient(); + return; + } const auto optionsChanged = crl::guard(weak, [=]( Ui::ForwardOptions options) { const auto newOptions = (options.hasCaptions