diff --git a/Telegram/SourceFiles/boxes/gift_premium_box.cpp b/Telegram/SourceFiles/boxes/gift_premium_box.cpp index 35067fdc5..77ff25e84 100644 --- a/Telegram/SourceFiles/boxes/gift_premium_box.cpp +++ b/Telegram/SourceFiles/boxes/gift_premium_box.cpp @@ -1203,9 +1203,9 @@ void AddStarGiftTable( const auto peerId = PeerId(entry.barePeerId); const auto session = &controller->session(); const auto unique = entry.uniqueGift.get(); - const auto chatPeerId = entry.fromGiftsList - ? entry.bareGiftOwnerId - : entry.barePeerId; + const auto selfBareId = session->userPeerId().value; + const auto giftToSelf = (peerId == session->userPeerId()) + && (!entry.fromGiftsList || entry.bareGiftOwnerId == selfBareId); if (unique) { const auto ownerId = PeerId(entry.bareGiftOwnerId); const auto transfer = entry.in @@ -1224,7 +1224,7 @@ void AddStarGiftTable( MakePeerTableValue(table, controller, ownerId, send, handler), st::giveawayGiftCodePeerMargin); } else if (peerId) { - if (chatPeerId != session->userPeerId().value) { + if (!giftToSelf) { const auto user = session->data().peer(peerId)->asUser(); const auto withSendButton = entry.in && user && !user->isBot(); auto send = withSendButton ? tr::lng_gift_send_small() : nullptr; diff --git a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp index ac1584329..cb2f23818 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp @@ -25,7 +25,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "lang/lang_keys.h" #include "main/main_session.h" #include "settings/settings_credits.h" // Settings::CreditsId -#include "settings/settings_credits_graphics.h" #include "settings/settings_credits_graphics.h" // GiftedCreditsBox #include "settings/settings_premium.h" // Settings::ShowGiftPremium #include "ui/chat/chat_style.h" @@ -47,13 +46,23 @@ PremiumGift::PremiumGift( PremiumGift::~PremiumGift() = default; int PremiumGift::top() { - return starGift() ? 0 : st::msgServiceGiftBoxStickerTop; + return starGift() + ? st::msgServiceStarGiftStickerTop + : st::msgServiceGiftBoxStickerTop; +} + +int PremiumGift::width() { + return st::msgServiceStarGiftBoxWidth; } QSize PremiumGift::size() { - return QSize( - st::msgServiceGiftBoxStickerSize, - st::msgServiceGiftBoxStickerSize); + return starGift() + ? QSize( + st::msgServiceStarGiftStickerSize, + st::msgServiceStarGiftStickerSize) + : QSize( + st::msgServiceGiftBoxStickerSize, + st::msgServiceGiftBoxStickerSize); } QString PremiumGift::title() { @@ -400,7 +409,7 @@ void PremiumGift::ensureStickerCreated() const { Assert(sticker != nullptr); _sticker.emplace(_parent, document, false, _parent); _sticker->setPlayingOnce(true); - _sticker->initSize(st::msgServiceGiftBoxStickerSize); + _sticker->initSize(st::msgServiceStarGiftStickerSize); _parent->repaint(); return; } diff --git a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.h b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.h index b782ea155..fcc503464 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.h +++ b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.h @@ -26,6 +26,7 @@ public: ~PremiumGift(); int top() override; + int width() override; QSize size() override; QString title() override; TextWithEntities subtitle() override; diff --git a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp index 16379d6ff..b64762a27 100644 --- a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp +++ b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp @@ -1006,10 +1006,9 @@ void ReceiptCreditsBox( } const auto selfPeerId = session->userPeerId().value; - const auto chatPeerId = e.fromGiftsList - ? e.bareGiftOwnerId - : e.barePeerId; - const auto giftToSelf = isStarGift && (selfPeerId == chatPeerId); + const auto giftToSelf = isStarGift + && (e.barePeerId == selfPeerId) + && (!e.fromGiftsList || e.bareGiftOwnerId == selfPeerId); if (!uniqueGift) { Ui::AddSkip(content); diff --git a/Telegram/SourceFiles/ui/chat/chat.style b/Telegram/SourceFiles/ui/chat/chat.style index ab2e51dce..cfd6c0400 100644 --- a/Telegram/SourceFiles/ui/chat/chat.style +++ b/Telegram/SourceFiles/ui/chat/chat.style @@ -917,9 +917,12 @@ msgServiceGiftBoxTopSkip: 4px; msgServiceGiftBoxButtonHeight: 32px; msgServiceGiftBoxButtonPadding: margins(2px, 0px, 2px, 0px); msgServiceGiftBoxButtonMargins: margins(0px, 13px, 0px, 17px); -msgServiceGiftBoxTitlePadding: margins(0px, 5px, 0px, 2px); +msgServiceGiftBoxTitlePadding: margins(0px, 20px, 0px, 6px); msgServiceGiftBoxStickerTop: -19px; msgServiceGiftBoxStickerSize: 140px; +msgServiceStarGiftBoxWidth: 224px; +msgServiceStarGiftStickerTop: 24px; +msgServiceStarGiftStickerSize: 100px; historySponsorInfoItem: FlatLabel(defaultFlatLabel) { style: TextStyle(defaultTextStyle) { @@ -1207,13 +1210,13 @@ botDownloadCancel: IconButton { } chatUniqueGiftBorder: 4px; -chatUniqueStickerPadding: margins(10px, 12px, 10px, 8px); +chatUniqueStickerPadding: margins(10px, 30px, 10px, 9px); chatUniqueTitle: TextStyle(defaultTextStyle) { font: font(16px semibold); } -chatUniqueTitlePadding: margins(12px, 4px, 12px, 2px); +chatUniqueTitlePadding: margins(12px, 12px, 12px, 2px); chatUniqueTextPadding: margins(12px, 2px, 12px, 8px); -chatUniqueTableSkip: 10px; +chatUniqueTableSkip: 9px; chatUniqueTableAtBottomPadding: margins(12px, 2px, 12px, 20px); chatUniqueRowSkip: 4px; chatUniqueButtonPadding: margins(12px, 4px, 12px, 16px);