2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 23:45:44 +00:00

Fix polls forwarding to private chats.

This commit is contained in:
John Preston
2023-02-07 16:28:59 +04:00
parent d7aa18cb0a
commit d889cd0e72
7 changed files with 23 additions and 27 deletions

View File

@@ -215,19 +215,11 @@ inline auto DefaultRestrictionValue(
return rpl::single(false);
}
using namespace rpl::mappers;
const auto other = rights & ~(ChatRestriction::SendPolls
| ChatRestriction::SendVoiceMessages
const auto other = rights & ~(ChatRestriction::SendVoiceMessages
| ChatRestriction::SendVideoMessages);
if (other) {
return PeerFlagValue(user, UserDataFlag::Deleted)
| rpl::map(!_1);
} else if (rights & ChatRestriction::SendPolls) {
if (CanSend(user, ChatRestriction::SendPolls)) {
return PeerFlagValue(user, UserDataFlag::Deleted)
| rpl::map(!_1);
} else if (rights == ChatRestriction::SendPolls) {
return rpl::single(false);
}
}
const auto mask = UserDataFlag::Deleted
| UserDataFlag::VoiceMessagesForbidden;