2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Display premium / fake / scam badge in group members.

This commit is contained in:
John Preston
2022-05-24 10:56:12 +04:00
parent 3b379c67ac
commit 490f6f7e50
4 changed files with 75 additions and 77 deletions

View File

@@ -30,6 +30,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/unixtime.h"
#include "ui/widgets/popup_menu.h"
#include "ui/ui_utility.h"
#include "info/profile/info_profile_values.h"
#include "window/window_session_controller.h"
#include "history/history.h"
#include "styles/style_menu_icons.h"
@@ -1930,8 +1931,19 @@ auto ParticipantsBoxController::computeType(
: (user && _additional.adminRights(user).has_value())
? Rights::Admin
: Rights::Normal;
// result.canRemove = _additional.canRemoveParticipant(participant);
result.adminRank = user ? _additional.adminRank(user) : QString();
using Badge = Info::Profile::Badge;
result.badge = !user
? Badge::None
: user->isScam()
? Badge::Scam
: user->isFake()
? Badge::Fake
: user->isVerified()
? Badge::Verified
: user->isPremium()
? Badge::Premium
: Badge::None;
return result;
}