mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-23 04:13:21 +02:00
Fix actions for converted gifts.
This commit is contained in:
parent
3463916b9b
commit
275fb3e96a
3 changed files with 10 additions and 8 deletions
|
@ -2738,7 +2738,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
Window::PeerMenuAddTodoListTasks(_controller, item);
|
Window::PeerMenuAddTodoListTasks(_controller, item);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
&st::menuIconCreateTodoList);
|
&st::menuIconAdd);
|
||||||
};
|
};
|
||||||
const auto lnkPhoto = link
|
const auto lnkPhoto = link
|
||||||
? reinterpret_cast<PhotoData*>(
|
? reinterpret_cast<PhotoData*>(
|
||||||
|
|
|
@ -681,7 +681,7 @@ bool AddTodoListAction(
|
||||||
if (const auto item = controller->session().data().message(itemId)) {
|
if (const auto item = controller->session().data().message(itemId)) {
|
||||||
Window::PeerMenuAddTodoListTasks(controller, item);
|
Window::PeerMenuAddTodoListTasks(controller, item);
|
||||||
}
|
}
|
||||||
}, &st::menuIconCreateTodoList);
|
}, &st::menuIconAdd);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -939,7 +939,8 @@ void FillUniqueGiftMenu(
|
||||||
&& e.id.isEmpty()
|
&& e.id.isEmpty()
|
||||||
&& (e.in || (giftChannel && giftChannel->canManageGifts()))
|
&& (e.in || (giftChannel && giftChannel->canManageGifts()))
|
||||||
&& !e.giftTransferred
|
&& !e.giftTransferred
|
||||||
&& !e.giftRefunded;
|
&& !e.giftRefunded
|
||||||
|
&& !e.converted;
|
||||||
|
|
||||||
const auto unique = e.uniqueGift;
|
const auto unique = e.uniqueGift;
|
||||||
if (unique
|
if (unique
|
||||||
|
@ -1148,7 +1149,6 @@ void GenericCreditsEntryBox(
|
||||||
const auto isStarGift = e.stargift || e.soldOutInfo;
|
const auto isStarGift = e.stargift || e.soldOutInfo;
|
||||||
const auto creditsHistoryStarGift = isStarGift && !e.id.isEmpty();
|
const auto creditsHistoryStarGift = isStarGift && !e.id.isEmpty();
|
||||||
const auto sentStarGift = creditsHistoryStarGift && !e.in;
|
const auto sentStarGift = creditsHistoryStarGift && !e.in;
|
||||||
const auto convertedStarGift = creditsHistoryStarGift && e.converted;
|
|
||||||
const auto giftToSelf = isStarGift
|
const auto giftToSelf = isStarGift
|
||||||
&& (e.barePeerId == selfPeerId)
|
&& (e.barePeerId == selfPeerId)
|
||||||
&& (e.in || e.bareGiftOwnerId == selfPeerId);
|
&& (e.in || e.bareGiftOwnerId == selfPeerId);
|
||||||
|
@ -1164,7 +1164,8 @@ void GenericCreditsEntryBox(
|
||||||
const auto starGiftCanManage = isStarGift
|
const auto starGiftCanManage = isStarGift
|
||||||
&& !creditsHistoryStarGift
|
&& !creditsHistoryStarGift
|
||||||
&& (e.in || giftToChannelCanManage)
|
&& (e.in || giftToChannelCanManage)
|
||||||
&& !e.fromGiftSlug;
|
&& !e.fromGiftSlug
|
||||||
|
&& !e.converted;
|
||||||
const auto starGiftCanTransfer = isStarGift
|
const auto starGiftCanTransfer = isStarGift
|
||||||
&& !creditsHistoryStarGift
|
&& !creditsHistoryStarGift
|
||||||
&& (e.in || giftToChannelCanTransfer);
|
&& (e.in || giftToChannelCanTransfer);
|
||||||
|
@ -1424,7 +1425,7 @@ void GenericCreditsEntryBox(
|
||||||
? tr::lng_credits_box_history_entry_gift_unavailable(tr::now)
|
? tr::lng_credits_box_history_entry_gift_unavailable(tr::now)
|
||||||
: sentStarGift
|
: sentStarGift
|
||||||
? tr::lng_credits_box_history_entry_gift_sent(tr::now)
|
? tr::lng_credits_box_history_entry_gift_sent(tr::now)
|
||||||
: convertedStarGift
|
: e.converted
|
||||||
? tr::lng_credits_box_history_entry_gift_converted(tr::now)
|
? tr::lng_credits_box_history_entry_gift_converted(tr::now)
|
||||||
: (isStarGift && !starGiftCanManage)
|
: (isStarGift && !starGiftCanManage)
|
||||||
? tr::lng_gift_link_label_gift(tr::now)
|
? tr::lng_gift_link_label_gift(tr::now)
|
||||||
|
@ -1627,7 +1628,7 @@ void GenericCreditsEntryBox(
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto arrow = Ui::Text::IconEmoji(&st::textMoreIconEmoji);
|
const auto arrow = Ui::Text::IconEmoji(&st::textMoreIconEmoji);
|
||||||
if (!uniqueGift && starGiftCanManage) {
|
if (!uniqueGift && (starGiftCanManage || e.converted)) {
|
||||||
Ui::AddSkip(content);
|
Ui::AddSkip(content);
|
||||||
const auto about = box->addRow(
|
const auto about = box->addRow(
|
||||||
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
object_ptr<Ui::CenterWrap<Ui::FlatLabel>>(
|
||||||
|
@ -1756,7 +1757,8 @@ void GenericCreditsEntryBox(
|
||||||
|
|
||||||
const auto canToggle = starGiftCanManage
|
const auto canToggle = starGiftCanManage
|
||||||
&& !e.giftTransferred
|
&& !e.giftTransferred
|
||||||
&& !e.giftRefunded;
|
&& !e.giftRefunded
|
||||||
|
&& !e.converted;
|
||||||
const auto toggleVisibility = [=, weak = Ui::MakeWeak(box)](bool save) {
|
const auto toggleVisibility = [=, weak = Ui::MakeWeak(box)](bool save) {
|
||||||
const auto showSection = !e.fromGiftsList;
|
const auto showSection = !e.fromGiftsList;
|
||||||
const auto savedId = EntryToSavedStarGiftId(&show->session(), e);
|
const auto savedId = EntryToSavedStarGiftId(&show->session(), e);
|
||||||
|
|
Loading…
Add table
Reference in a new issue