mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 22:16:14 +00:00
Implement correct ForumTopic::canWrite logic.
This commit is contained in:
@@ -552,11 +552,14 @@ bool ChannelData::canPublish() const {
|
||||
|| (adminRights() & AdminRight::PostMessages);
|
||||
}
|
||||
|
||||
bool ChannelData::canWrite() const {
|
||||
bool ChannelData::canWrite(bool checkForForum) const {
|
||||
// Duplicated in Data::CanWriteValue().
|
||||
const auto allowed = amIn()
|
||||
|| ((flags() & Flag::HasLink) && !(flags() & Flag::JoinToWrite));
|
||||
return allowed && (canPublish()
|
||||
const auto forumRestriction = checkForForum && isForum();
|
||||
return allowed
|
||||
&& !forumRestriction
|
||||
&& (canPublish()
|
||||
|| (!isBroadcast()
|
||||
&& !amRestricted(Restriction::SendMessages)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user