mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Allow group / channel type box if !can_edit_username.
This commit is contained in:
parent
596c4a06a3
commit
4cb6e4b787
1 changed files with 21 additions and 28 deletions
|
@ -206,6 +206,7 @@ void Controller::createContent() {
|
|||
AddSkip(_wrap.get());
|
||||
AddDividerText(_wrap.get(), tr::lng_group_invite_manage_about());
|
||||
|
||||
if (!_linkOnly) {
|
||||
AddSkip(_wrap.get());
|
||||
AddSubsectionTitle(_wrap.get(), tr::lng_manage_peer_no_forwards_title());
|
||||
_controls.noForwards = _wrap->add(EditPeerInfoBox::CreateButton(
|
||||
|
@ -224,7 +225,7 @@ void Controller::createContent() {
|
|||
}, _wrap->lifetime());
|
||||
AddSkip(_wrap.get());
|
||||
AddDividerText(_wrap.get(), tr::lng_manage_peer_no_forwards_about());
|
||||
|
||||
}
|
||||
if (_linkOnly) {
|
||||
_controls.inviteLinkWrap->show(anim::type::instant);
|
||||
} else {
|
||||
|
@ -267,15 +268,7 @@ void Controller::addRoundButton(
|
|||
void Controller::fillPrivaciesButtons(
|
||||
not_null<Ui::VerticalLayout*> parent,
|
||||
std::optional<Privacy> savedValue) {
|
||||
const auto canEditUsername = [&] {
|
||||
if (const auto chat = _peer->asChat()) {
|
||||
return chat->canEditUsername();
|
||||
} else if (const auto channel = _peer->asChannel()) {
|
||||
return channel->canEditUsername();
|
||||
}
|
||||
Unexpected("Peer type in Controller::createPrivaciesEdit.");
|
||||
}();
|
||||
if (!canEditUsername || _linkOnly) {
|
||||
if (_linkOnly) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue