2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Implement correct ForumTopic::canWrite logic.

This commit is contained in:
John Preston
2022-10-25 11:20:22 +04:00
parent 1cd02fc3c9
commit 602ba5bba9
35 changed files with 363 additions and 144 deletions

View File

@@ -205,6 +205,13 @@ bool ForumTopic::my() const {
return (_flags & Flag::My);
}
bool ForumTopic::canWrite() const {
const auto channel = this->channel();
return channel->amIn()
&& !channel->amRestricted(ChatRestriction::SendMessages)
&& (!closed() || canToggleClosed());
}
bool ForumTopic::canEdit() const {
return my() || channel()->canManageTopics();
}