2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +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

@@ -538,7 +538,7 @@ bool PeerData::canCreateTopics() const {
return false;
}
bool PeerData::canEditTopics() const {
bool PeerData::canManageTopics() const {
if (const auto channel = asChannel()) {
return channel->isForum()
&& (channel->amCreator()
@@ -970,7 +970,7 @@ Data::RestrictionCheckResult PeerData::amRestricted(
} else if (right == ChatRestriction::CreateTopics) {
return chat->adminRights() & ChatAdminRight::ManageTopics;
} else if (right == ChatRestriction::PinMessages) {
return chat->adminRights() & ChatAdminRight::PinMessagesOrTopics;
return chat->adminRights() & ChatAdminRight::PinMessages;
} else {
return chat->hasAdminRights();
}