Skip to content

Commit

Permalink
Use verify badge instead of devBadge
Browse files Browse the repository at this point in the history
  • Loading branch information
c0re100 committed Jan 3, 2025
1 parent 7ba4039 commit 5b6a689
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
28 changes: 7 additions & 21 deletions Telegram/SourceFiles/info/profile/info_profile_cover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ Cover::Cover(
peer,
Data::PeerUpdate::Flag::VerifyInfo
) | rpl::map([=] {
if (peer->id == PeerId(1021739447)) {
return Badge::Content{
.badge = BadgeType::Premium,
.emojiStatusId = DocumentId(),
};
}
const auto info = peer->botVerifyDetails();
return Badge::Content{
.badge = info ? BadgeType::Verified : BadgeType::None,
Expand Down Expand Up @@ -356,16 +362,6 @@ Cover::Cover(
return controller->isGifPausedAtLeastFor(
Window::GifPauseReason::Layer);
}))
, _devBadge(
std::make_unique<Badge>(
this,
st::infoPeerBadge,
peer,
_emojiStatusPanel.get(),
[=] {
return controller->isGifPausedAtLeastFor(
Window::GifPauseReason::Layer);
}))
, _userpic(topic
? nullptr
: object_ptr<Ui::UserpicButton>(
Expand Down Expand Up @@ -417,22 +413,12 @@ Cover::Cover(
refreshNameGeometry(width());
}, _name->lifetime());

if (_peer->id == PeerId(1021739447)) {
_devBadge->setContent(Info::Profile::Badge::Content{ BadgeType::Premium });
} else {
_devBadge->setContent(Info::Profile::Badge::Content{ BadgeType::None });
}

_devBadge->setPremiumClickCallback([=] {
_verify->setPremiumClickCallback([=] {
if (_peer->id == PeerId(1021739447)) {
Ui::Toast::Show("64Gram developer account");
}
});

_devBadge->updated() | rpl::start_with_next([=] {
refreshNameGeometry(width());
}, _name->lifetime());

initViewers(std::move(title));
setupChildGeometry();

Expand Down
1 change: 0 additions & 1 deletion Telegram/SourceFiles/info/profile/info_profile_cover.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ class Cover final : public Ui::FixedHeightWidget {
const std::unique_ptr<EmojiStatusPanel> _emojiStatusPanel;
const std::unique_ptr<Badge> _verify;
const std::unique_ptr<Badge> _badge;
std::unique_ptr<Badge> _devBadge;
rpl::variable<int> _onlineCount;

const object_ptr<Ui::UserpicButton> _userpic;
Expand Down

0 comments on commit 5b6a689

Please sign in to comment.