2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +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

@@ -206,7 +206,7 @@ bool ForumTopic::my() const {
}
bool ForumTopic::canEdit() const {
return my() || channel()->canEditTopics();
return my() || channel()->canManageTopics();
}
bool ForumTopic::canDelete() const {
@@ -223,12 +223,7 @@ bool ForumTopic::canToggleClosed() const {
}
bool ForumTopic::canTogglePinned() const {
if (creating()) {
return false;
}
const auto channel = this->channel();
return channel->amCreator()
|| (channel->adminRights() & ChatAdminRight::PinMessagesOrTopics);
return !creating() && channel()->canManageTopics();
}
bool ForumTopic::creating() const {