2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Allow posting comments being not in group.

This commit is contained in:
John Preston
2020-09-11 14:14:24 +03:00
parent 47170da813
commit 6f9ea1cc01
2 changed files with 6 additions and 4 deletions

View File

@@ -207,6 +207,7 @@ rpl::producer<bool> CanWriteValue(ChatData *chat) {
rpl::producer<bool> CanWriteValue(ChannelData *channel) {
const auto mask = 0
| MTPDchannel::Flag::f_left
| MTPDchannel::Flag::f_has_link
| MTPDchannel_ClientFlag::f_forbidden
| MTPDchannel::Flag::f_creator
| MTPDchannel::Flag::f_broadcast;
@@ -229,8 +230,9 @@ rpl::producer<bool> CanWriteValue(ChannelData *channel) {
const auto notAmInFlags = 0
| MTPDchannel::Flag::f_left
| MTPDchannel_ClientFlag::f_forbidden;
return !(flags & notAmInFlags)
&& (postMessagesRight
const auto allowed = !(flags & notAmInFlags)
|| (flags & MTPDchannel::Flag::f_has_link);
return allowed && (postMessagesRight
|| (flags & MTPDchannel::Flag::f_creator)
|| (!(flags & MTPDchannel::Flag::f_broadcast)
&& !sendMessagesRestriction