mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 05:07:10 +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);
|
||||
|
||||
if (!hasOnlyForcedForwardedInfo) {
|
||||
if (!hasOnlyForcedForwardedInfo
|
||||
&& !HasOnlyDroppedForwardedInfo(items)) {
|
||||
Settings::AddButtonWithIcon(
|
||||
bottom,
|
||||
(dropNames
|
||||
|
|
|
@ -153,7 +153,7 @@ void ForwardPanel::updateTexts() {
|
|||
Unexpected("Corrupt forwarded information in message.");
|
||||
}
|
||||
}
|
||||
if (!keepNames) {
|
||||
if (!keepNames || HasOnlyDroppedForwardedInfo(_data.items)) {
|
||||
from = tr::lng_forward_sender_names_removed(tr::now);
|
||||
} else if (names.size() > 2) {
|
||||
from = tr::lng_forwarding_from(
|
||||
|
@ -445,4 +445,13 @@ bool HasOnlyForcedForwardedInfo(const HistoryItemsList &list) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool HasOnlyDroppedForwardedInfo(const HistoryItemsList &list) {
|
||||
for (const auto &item : list) {
|
||||
if (!item->computeDropForwardedInfo()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace HistoryView::Controls
|
||||
|
|
|
@ -85,5 +85,6 @@ void EditWebPageOptions(
|
|||
Fn<void(Data::WebPageDraft)> done);
|
||||
|
||||
[[nodiscard]] bool HasOnlyForcedForwardedInfo(const HistoryItemsList &list);
|
||||
[[nodiscard]] bool HasOnlyDroppedForwardedInfo(const HistoryItemsList &list);
|
||||
|
||||
} // namespace HistoryView::Controls
|
||||
|
|
Loading…
Add table
Reference in a new issue