2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Update some premium icons.

This commit is contained in:
John Preston
2022-05-20 19:28:50 +04:00
parent 9c9eae05a8
commit d81bba155a
36 changed files with 59 additions and 22 deletions

View File

@@ -323,15 +323,23 @@ rpl::producer<bool> CanManageGroupCallValue(not_null<PeerData*> peer) {
return rpl::single(false);
}
rpl::producer<bool> AmPremiumValue(not_null<Main::Session*> session) {
return session->user()->flagsValue(
rpl::producer<bool> PeerPremiumValue(not_null<PeerData*> peer) {
const auto user = peer->asUser();
if (!user) {
return rpl::single(false);
}
return user->flagsValue(
) | rpl::filter([=](UserData::Flags::Change change) {
return (change.diff & UserDataFlag::Premium);
}) | rpl::map([=] {
return session->user()->isPremium();
return user->isPremium();
});
}
rpl::producer<bool> AmPremiumValue(not_null<Main::Session*> session) {
return PeerPremiumValue(session->user());
}
TimeId SortByOnlineValue(not_null<UserData*> user, TimeId now) {
if (user->isServiceUser() || user->isBot()) {
return -1;