mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Always show premium badge in support mode.
This commit is contained in:
@@ -177,7 +177,8 @@ void Cover::initViewers(rpl::producer<QString> title) {
|
|||||||
BadgeValue(
|
BadgeValue(
|
||||||
_peer
|
_peer
|
||||||
) | rpl::start_with_next([=](Badge badge) {
|
) | rpl::start_with_next([=](Badge badge) {
|
||||||
if (badge == Badge::Premium && !_peer->session().premiumPossible()) {
|
if (badge == Badge::Premium
|
||||||
|
&& !_peer->session().premiumBadgesShown()) {
|
||||||
badge = Badge::None;
|
badge = Badge::None;
|
||||||
}
|
}
|
||||||
setBadge(badge);
|
setBadge(badge);
|
||||||
|
@@ -236,6 +236,10 @@ bool Session::premiumPossible() const {
|
|||||||
return premium() || _premiumPossible.current();
|
return premium() || _premiumPossible.current();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Session::premiumBadgesShown() const {
|
||||||
|
return supportMode() || premiumPossible();
|
||||||
|
}
|
||||||
|
|
||||||
rpl::producer<bool> Session::premiumPossibleValue() const {
|
rpl::producer<bool> Session::premiumPossibleValue() const {
|
||||||
using namespace rpl::mappers;
|
using namespace rpl::mappers;
|
||||||
|
|
||||||
|
@@ -83,6 +83,7 @@ public:
|
|||||||
[[nodiscard]] bool premium() const;
|
[[nodiscard]] bool premium() const;
|
||||||
[[nodiscard]] bool premiumPossible() const;
|
[[nodiscard]] bool premiumPossible() const;
|
||||||
[[nodiscard]] rpl::producer<bool> premiumPossibleValue() const;
|
[[nodiscard]] rpl::producer<bool> premiumPossibleValue() const;
|
||||||
|
[[nodiscard]] bool premiumBadgesShown() const;
|
||||||
|
|
||||||
[[nodiscard]] uint64 uniqueId() const; // userId() with TestDC shift.
|
[[nodiscard]] uint64 uniqueId() const; // userId() with TestDC shift.
|
||||||
[[nodiscard]] UserId userId() const;
|
[[nodiscard]] UserId userId() const;
|
||||||
|
@@ -120,7 +120,7 @@ int DrawPeerBadgeGetWidth(
|
|||||||
return iconw;
|
return iconw;
|
||||||
} else if (peer->isPremium()
|
} else if (peer->isPremium()
|
||||||
&& st.premium
|
&& st.premium
|
||||||
&& peer->session().premiumPossible()) {
|
&& peer->session().premiumBadgesShown()) {
|
||||||
const auto iconw = st.premium->width();
|
const auto iconw = st.premium->width();
|
||||||
st.premium->paint(
|
st.premium->paint(
|
||||||
p,
|
p,
|
||||||
|
Reference in New Issue
Block a user