Upgrade gift while staying in the same box.

This commit is contained in:
John Preston
2025-12-11 22:05:26 +04:00
parent 32bdb5a519
commit 703f77ac93
8 changed files with 852 additions and 414 deletions

View File

@@ -1205,7 +1205,7 @@ void AddStarGiftTable(
Settings::CreditsEntryBoxStyleOverrides st,
const Data::CreditsHistoryEntry &entry,
Fn<void()> convertToStars,
Fn<void()> startUpgrade,
bool canStartUpgrade,
Fn<void(Fn<void()> removed)> removeDetails) {
const auto table = container->add(
object_ptr<Ui::TableLayout>(
@@ -1426,7 +1426,7 @@ void AddStarGiftTable(
std::move(amount),
Ui::Text::WithEntities)));
}
if (!unique && !entry.soldOutInfo && startUpgrade) {
if (!unique && !entry.soldOutInfo && canStartUpgrade) {
AddTableRow(
table,
tr::lng_gift_unique_status(),

View File

@@ -78,7 +78,7 @@ void AddStarGiftTable(
Settings::CreditsEntryBoxStyleOverrides st,
const Data::CreditsHistoryEntry &entry,
Fn<void()> convertToStars,
Fn<void()> startUpgrade,
bool canStartUpgrade,
Fn<void(Fn<void()> removed)> removeDetails);
void AddTransferGiftTable(
std::shared_ptr<ChatHelpers::Show> show,

File diff suppressed because it is too large Load Diff

View File

@@ -119,8 +119,9 @@ void GiftReleasedByHandler(not_null<PeerData*> peer);
struct StarGiftUpgradeArgs {
not_null<Window::SessionController*> controller;
base::required<uint64> stargiftId;
Data::StarGift stargift;
Fn<void(bool)> ready;
Fn<void()> upgraded;
not_null<PeerData*> peer;
Data::SavedStarGiftId savedId;
QString giftPrepayUpgradeHash;