2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Added initial box for premium gifts.

This commit is contained in:
23rd
2022-07-03 17:56:12 +03:00
committed by John Preston
parent 2a3d72ad2e
commit c7c8ebed13
14 changed files with 407 additions and 5 deletions

View File

@@ -202,6 +202,7 @@ private:
void addNewMembers();
void addDeleteContact();
void addTTLSubmenu(bool addSeparator);
void addGiftPremium();
not_null<SessionController*> _controller;
Dialogs::EntryState _request;
@@ -806,6 +807,24 @@ void Filler::addTTLSubmenu(bool addSeparator) {
}
}
void Filler::addGiftPremium() {
const auto user = _peer->asUser();
if (!user
|| user->isInaccessible()
|| user->isSelf()
|| user->isBot()
|| user->isNotificationsUser()
|| !user->canReceiveGifts()
|| user->isRepliesChat()) {
return;
}
const auto navigation = _controller;
_addAction(tr::lng_profile_gift_premium(tr::now), [=] {
navigation->showGiftPremiumBox(user);
}, &st::menuIconGiftPremium);
}
void Filler::fill() {
if (_folder) {
fillArchiveActions();
@@ -862,6 +881,7 @@ void Filler::fillProfileActions() {
addNewContact();
addShareContact();
addEditContact();
addGiftPremium();
addBotToGroup();
addNewMembers();
addManageChat();