mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 23:27:09 +02:00
Always show premium badge in support mode.
This commit is contained in:
parent
b84c876ba2
commit
1b9232e28d
4 changed files with 8 additions and 2 deletions
|
@ -177,7 +177,8 @@ void Cover::initViewers(rpl::producer<QString> title) {
|
|||
BadgeValue(
|
||||
_peer
|
||||
) | rpl::start_with_next([=](Badge badge) {
|
||||
if (badge == Badge::Premium && !_peer->session().premiumPossible()) {
|
||||
if (badge == Badge::Premium
|
||||
&& !_peer->session().premiumBadgesShown()) {
|
||||
badge = Badge::None;
|
||||
}
|
||||
setBadge(badge);
|
||||
|
|
|
@ -236,6 +236,10 @@ bool Session::premiumPossible() const {
|
|||
return premium() || _premiumPossible.current();
|
||||
}
|
||||
|
||||
bool Session::premiumBadgesShown() const {
|
||||
return supportMode() || premiumPossible();
|
||||
}
|
||||
|
||||
rpl::producer<bool> Session::premiumPossibleValue() const {
|
||||
using namespace rpl::mappers;
|
||||
|
||||
|
|
|
@ -83,6 +83,7 @@ public:
|
|||
[[nodiscard]] bool premium() const;
|
||||
[[nodiscard]] bool premiumPossible() const;
|
||||
[[nodiscard]] rpl::producer<bool> premiumPossibleValue() const;
|
||||
[[nodiscard]] bool premiumBadgesShown() const;
|
||||
|
||||
[[nodiscard]] uint64 uniqueId() const; // userId() with TestDC shift.
|
||||
[[nodiscard]] UserId userId() const;
|
||||
|
|
|
@ -120,7 +120,7 @@ int DrawPeerBadgeGetWidth(
|
|||
return iconw;
|
||||
} else if (peer->isPremium()
|
||||
&& st.premium
|
||||
&& peer->session().premiumPossible()) {
|
||||
&& peer->session().premiumBadgesShown()) {
|
||||
const auto iconw = st.premium->width();
|
||||
st.premium->paint(
|
||||
p,
|
||||
|
|
Loading…
Add table
Reference in a new issue