mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +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,12 +1187,15 @@ void ParticipantsBoxController::prepare() {
|
||||||
}
|
}
|
||||||
Unexpected("Role in ParticipantsBoxController::prepare()");
|
Unexpected("Role in ParticipantsBoxController::prepare()");
|
||||||
}();
|
}();
|
||||||
if ((_role == Role::Admins) && _peer->isMegagroup()) {
|
if (const auto megagroup = _peer->asMegagroup()) {
|
||||||
|
if ((_role == Role::Admins)
|
||||||
|
&& (megagroup->amCreator() || megagroup->hasAdminRights())) {
|
||||||
const auto validator = AntiSpamMenu::AntiSpamValidator(
|
const auto validator = AntiSpamMenu::AntiSpamValidator(
|
||||||
_navigation->parentController(),
|
_navigation->parentController(),
|
||||||
_peer->asChannel());
|
_peer->asChannel());
|
||||||
delegate()->peerListSetAboveWidget(validator.createButton());
|
delegate()->peerListSetAboveWidget(validator.createButton());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
|
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
|
||||||
delegate()->peerListSetTitle(std::move(title));
|
delegate()->peerListSetTitle(std::move(title));
|
||||||
setDescriptionText(tr::lng_contacts_loading(tr::now));
|
setDescriptionText(tr::lng_contacts_loading(tr::now));
|
||||||
|
|
Loading…
Add table
Reference in a new issue