Removed forwarding options for dices.

This commit is contained in:
23rd 2021-09-03 12:17:40 +03:00 committed by John Preston
parent 58da62b413
commit d4c0ac5e4a
1 changed files with 18 additions and 2 deletions

View File

@ -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