From 6710ef3e2f16c99790e3c3fee49cdf9f0346289b Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 19:27:38 +0300 Subject: [PATCH] fixed admin badge display in groups --- Telegram/SourceFiles/app.cpp | 1 - Telegram/SourceFiles/profilewidget.cpp | 2 +- Telegram/SourceFiles/structs.h | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index df9c75bdec..e9d2bbe5c9 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -891,7 +891,6 @@ namespace App { } } else { chat->flags &= ~MTPDchat::Flag::f_admins_enabled; - chat->flags &= ~MTPDchat::Flag::f_admin; } if (emitPeerUpdated) { App::main()->peerUpdated(chat); diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 1aaaf2898a..a3036db889 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -1034,7 +1034,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) { data->online = App::onlineText(user, l_time); } if (_peerChat) { - data->admin = (peerFromUser(_peerChat->creator) == user->id) || (_peerChat->admins.constFind(user) != _peerChat->admins.cend()); + data->admin = (peerFromUser(_peerChat->creator) == user->id) || (_peerChat->adminsEnabled() && (_peerChat->admins.constFind(user) != _peerChat->admins.cend())); } else if (_peerChannel) { data->admin = (_peerChannel->mgInfo->lastAdmins.constFind(user) != _peerChannel->mgInfo->lastAdmins.cend()); } else { diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 304fb2974e..4896a0cea9 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -491,7 +491,7 @@ public: return flags & MTPDchat::Flag::f_creator; } bool amAdmin() const { - return flags & MTPDchat::Flag::f_admin; + return (flags & MTPDchat::Flag::f_admin) && adminsEnabled(); } bool isDeactivated() const { return flags & MTPDchat::Flag::f_deactivated;