mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 06:55:58 +00:00
Implement correct ForumTopic::canWrite logic.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user