2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Handle today-birthday click in profile.

This commit is contained in:
John Preston
2024-03-29 18:59:24 +04:00
parent 20123fca7f
commit d788f5afac
7 changed files with 150 additions and 14 deletions

View File

@@ -1014,6 +1014,30 @@ void GiftPremiumValidator::showChoosePeerBox(const QString &ref) {
}, _manyGiftsLifetime);
}
void GiftPremiumValidator::showChosenPeerBox(
not_null<UserData*> user,
const QString &ref) {
if (_manyGiftsLifetime) {
return;
}
using namespace Api;
const auto api = _manyGiftsLifetime.make_state<PremiumGiftCodeOptions>(
_controller->session().user());
const auto show = _controller->uiShow();
api->request(
) | rpl::start_with_error_done([=](const QString &error) {
show->showToast(error);
}, [=] {
const auto users = std::vector<not_null<UserData*>>{ user };
const auto giftBox = show->show(
Box(GiftsBox, _controller, users, api, ref));
giftBox->boxClosing(
) | rpl::start_with_next([=] {
_manyGiftsLifetime.destroy();
}, giftBox->lifetime());
}, _manyGiftsLifetime);
}
void GiftPremiumValidator::showBox(not_null<UserData*> user) {
if (_requestId) {
return;