mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Improve phrases for forward-from-saved.
This commit is contained in:
parent
1c8b165a64
commit
428a3cf0ce
3 changed files with 13 additions and 2 deletions
|
@ -947,7 +947,8 @@ void DraftOptionsBox(
|
||||||
|
|
||||||
AddFilledSkip(bottom);
|
AddFilledSkip(bottom);
|
||||||
|
|
||||||
if (!hasOnlyForcedForwardedInfo) {
|
if (!hasOnlyForcedForwardedInfo
|
||||||
|
&& !HasOnlyDroppedForwardedInfo(items)) {
|
||||||
Settings::AddButtonWithIcon(
|
Settings::AddButtonWithIcon(
|
||||||
bottom,
|
bottom,
|
||||||
(dropNames
|
(dropNames
|
||||||
|
|
|
@ -153,7 +153,7 @@ void ForwardPanel::updateTexts() {
|
||||||
Unexpected("Corrupt forwarded information in message.");
|
Unexpected("Corrupt forwarded information in message.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!keepNames) {
|
if (!keepNames || HasOnlyDroppedForwardedInfo(_data.items)) {
|
||||||
from = tr::lng_forward_sender_names_removed(tr::now);
|
from = tr::lng_forward_sender_names_removed(tr::now);
|
||||||
} else if (names.size() > 2) {
|
} else if (names.size() > 2) {
|
||||||
from = tr::lng_forwarding_from(
|
from = tr::lng_forwarding_from(
|
||||||
|
@ -445,4 +445,13 @@ bool HasOnlyForcedForwardedInfo(const HistoryItemsList &list) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HasOnlyDroppedForwardedInfo(const HistoryItemsList &list) {
|
||||||
|
for (const auto &item : list) {
|
||||||
|
if (!item->computeDropForwardedInfo()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace HistoryView::Controls
|
} // namespace HistoryView::Controls
|
||||||
|
|
|
@ -85,5 +85,6 @@ void EditWebPageOptions(
|
||||||
Fn<void(Data::WebPageDraft)> done);
|
Fn<void(Data::WebPageDraft)> done);
|
||||||
|
|
||||||
[[nodiscard]] bool HasOnlyForcedForwardedInfo(const HistoryItemsList &list);
|
[[nodiscard]] bool HasOnlyForcedForwardedInfo(const HistoryItemsList &list);
|
||||||
|
[[nodiscard]] bool HasOnlyDroppedForwardedInfo(const HistoryItemsList &list);
|
||||||
|
|
||||||
} // namespace HistoryView::Controls
|
} // namespace HistoryView::Controls
|
||||||
|
|
Loading…
Add table
Reference in a new issue