mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Show anti-spam checkbox only to admins.
This commit is contained in:
parent
273a2809cf
commit
74ecd44294
1 changed files with 8 additions and 5 deletions
|
@ -1187,11 +1187,14 @@ void ParticipantsBoxController::prepare() {
|
|||
}
|
||||
Unexpected("Role in ParticipantsBoxController::prepare()");
|
||||
}();
|
||||
if ((_role == Role::Admins) && _peer->isMegagroup()) {
|
||||
const auto validator = AntiSpamMenu::AntiSpamValidator(
|
||||
_navigation->parentController(),
|
||||
_peer->asChannel());
|
||||
delegate()->peerListSetAboveWidget(validator.createButton());
|
||||
if (const auto megagroup = _peer->asMegagroup()) {
|
||||
if ((_role == Role::Admins)
|
||||
&& (megagroup->amCreator() || megagroup->hasAdminRights())) {
|
||||
const auto validator = AntiSpamMenu::AntiSpamValidator(
|
||||
_navigation->parentController(),
|
||||
_peer->asChannel());
|
||||
delegate()->peerListSetAboveWidget(validator.createButton());
|
||||
}
|
||||
}
|
||||
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
|
||||
delegate()->peerListSetTitle(std::move(title));
|
||||
|
|
Loading…
Add table
Reference in a new issue