2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-03 16:05:57 +00:00

Support topic closing.

This commit is contained in:
John Preston
2022-10-18 19:39:41 +04:00
parent fe41fbd7e9
commit ad2f9438a2
9 changed files with 132 additions and 17 deletions

View File

@@ -534,6 +534,15 @@ bool PeerData::canCreateTopics() const {
return isForum() && canPinMessages();
}
bool PeerData::canEditTopics() const {
if (const auto channel = asChannel()) {
return channel->isForum()
&& (channel->amCreator()
|| (channel->adminRights() & ChatAdminRight::PinMessages));
}
return false;
}
bool PeerData::canEditMessagesIndefinitely() const {
if (const auto user = asUser()) {
return user->isSelf();