mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Always allow group admins to edit invite link.
Show Group Info even if supergroup admin can't edit information.
This commit is contained in:
parent
3b3a705a67
commit
b20c2b4774
1 changed files with 10 additions and 1 deletions
|
@ -102,7 +102,16 @@ void ShowRecentActions(
|
||||||
not_null<Window::Controller*> controller,
|
not_null<Window::Controller*> controller,
|
||||||
not_null<ChannelData*> channel) {
|
not_null<ChannelData*> channel) {
|
||||||
controller->showSection(AdminLog::SectionMemento(channel));
|
controller->showSection(AdminLog::SectionMemento(channel));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HasEditInfoBox(not_null<ChannelData*> channel) {
|
||||||
|
if (channel->canEditInformation()) {
|
||||||
|
return true;
|
||||||
|
} else if (!channel->isPublic() && channel->canAddMembers()) {
|
||||||
|
// Edit invite link.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FillManageBox(
|
void FillManageBox(
|
||||||
|
@ -112,7 +121,7 @@ void FillManageBox(
|
||||||
using Profile::ParticipantsBoxController;
|
using Profile::ParticipantsBoxController;
|
||||||
|
|
||||||
auto isGroup = channel->isMegagroup();
|
auto isGroup = channel->isMegagroup();
|
||||||
if (channel->canEditInformation()) {
|
if (HasEditInfoBox(channel)) {
|
||||||
AddButton(
|
AddButton(
|
||||||
content,
|
content,
|
||||||
Lang::Viewer(isGroup
|
Lang::Viewer(isGroup
|
||||||
|
|
Loading…
Add table
Reference in a new issue