mirror of https://github.com/procxx/kepka.git
Only creator can restrict in old groups.
This commit is contained in:
parent
93a967dc74
commit
25b5027dc7
|
@ -1377,13 +1377,19 @@ base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
||||||
crl::guard(this, [=] { showAdmin(user); }));
|
crl::guard(this, [=] { showAdmin(user); }));
|
||||||
}
|
}
|
||||||
if (_additional.canRestrictUser(user)) {
|
if (_additional.canRestrictUser(user)) {
|
||||||
const auto isGroup = _peer->isChat() || _peer->isMegagroup();
|
const auto canRestrictWithoutKick = [&] {
|
||||||
if (isGroup) {
|
if (const auto chat = _peer->asChat()) {
|
||||||
|
return chat->amCreator();
|
||||||
|
}
|
||||||
|
return _peer->isMegagroup();
|
||||||
|
}();
|
||||||
|
if (canRestrictWithoutKick) {
|
||||||
result->addAction(
|
result->addAction(
|
||||||
lang(lng_context_restrict_user),
|
lang(lng_context_restrict_user),
|
||||||
crl::guard(this, [=] { showRestricted(user); }));
|
crl::guard(this, [=] { showRestricted(user); }));
|
||||||
}
|
}
|
||||||
if (!_additional.isKicked(user)) {
|
if (!_additional.isKicked(user)) {
|
||||||
|
const auto isGroup = _peer->isChat() || _peer->isMegagroup();
|
||||||
result->addAction(
|
result->addAction(
|
||||||
lang(isGroup
|
lang(isGroup
|
||||||
? lng_context_remove_from_group
|
? lng_context_remove_from_group
|
||||||
|
|
Loading…
Reference in New Issue