2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Handle join-to-write / request-to-join in comments section.

This commit is contained in:
John Preston
2022-04-21 18:29:49 +04:00
parent 5874ae7c51
commit 2f6f432583
6 changed files with 127 additions and 15 deletions

View File

@@ -467,7 +467,8 @@ bool ChannelData::canPublish() const {
bool ChannelData::canWrite() const {
// Duplicated in Data::CanWriteValue().
const auto allowed = amIn() || (flags() & Flag::HasLink);
const auto allowed = amIn()
|| ((flags() & Flag::HasLink) && !(flags() & Flag::JoinToWrite));
return allowed && (canPublish()
|| (!isBroadcast()
&& !amRestricted(Restriction::SendMessages)));