fixed admin badge display in groups

This commit is contained in:
John Preston 2016-03-24 19:27:38 +03:00
parent 978e86a8ba
commit 6710ef3e2f
3 changed files with 2 additions and 3 deletions

View File

@ -891,7 +891,6 @@ namespace App {
} }
} else { } else {
chat->flags &= ~MTPDchat::Flag::f_admins_enabled; chat->flags &= ~MTPDchat::Flag::f_admins_enabled;
chat->flags &= ~MTPDchat::Flag::f_admin;
} }
if (emitPeerUpdated) { if (emitPeerUpdated) {
App::main()->peerUpdated(chat); App::main()->peerUpdated(chat);

View File

@ -1034,7 +1034,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) {
data->online = App::onlineText(user, l_time); data->online = App::onlineText(user, l_time);
} }
if (_peerChat) { 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) { } else if (_peerChannel) {
data->admin = (_peerChannel->mgInfo->lastAdmins.constFind(user) != _peerChannel->mgInfo->lastAdmins.cend()); data->admin = (_peerChannel->mgInfo->lastAdmins.constFind(user) != _peerChannel->mgInfo->lastAdmins.cend());
} else { } else {

View File

@ -491,7 +491,7 @@ public:
return flags & MTPDchat::Flag::f_creator; return flags & MTPDchat::Flag::f_creator;
} }
bool amAdmin() const { bool amAdmin() const {
return flags & MTPDchat::Flag::f_admin; return (flags & MTPDchat::Flag::f_admin) && adminsEnabled();
} }
bool isDeactivated() const { bool isDeactivated() const {
return flags & MTPDchat::Flag::f_deactivated; return flags & MTPDchat::Flag::f_deactivated;