2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Simplify pin_messages/manage_topics logic.

This commit is contained in:
John Preston
2022-10-24 15:52:43 +04:00
parent 72354f52d4
commit b4a9705564
14 changed files with 16 additions and 59 deletions

View File

@@ -224,7 +224,7 @@ ChatAdminRightsInfo EditAdminBox::defaultRights() const {
| Flag::BanUsers
| Flag::InviteByLinkOrAdd
| Flag::ManageTopics
| Flag::PinMessagesOrTopics
| Flag::PinMessages
| Flag::ManageCall) }
: ChatAdminRightsInfo{ (Flag::ChangeInfo
| Flag::PostMessages
@@ -329,14 +329,10 @@ void EditAdminBox::prepare() {
const auto anyoneCanAddMembers = chat
? chat->anyoneCanAddMembers()
: channel->anyoneCanAddMembers();
const auto anyoneCanPinMessages = chat
? chat->anyoneCanPinMessages()
: channel->anyoneCanPinMessages();
const auto options = Data::AdminRightsSetOptions{
.isGroup = isGroup,
.isForum = peer()->isForum(),
.anyoneCanAddMembers = anyoneCanAddMembers,
.anyoneCanPinMessages = anyoneCanPinMessages,
};
auto [checkboxes, getChecked, changes] = CreateEditAdminRights(
inner,