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

Show "premium required" information in chat.

This commit is contained in:
John Preston
2024-01-11 23:20:36 +04:00
parent c765bee0cd
commit e5cda0e2b1
27 changed files with 566 additions and 200 deletions

View File

@@ -1101,6 +1101,9 @@ Data::RestrictionCheckResult PeerData::amRestricted(
}
};
if (const auto user = asUser()) {
if (user->meRequiresPremiumToWrite() && !user->session().premium()) {
return Result::Explicit();
}
return (right == ChatRestriction::SendVoiceMessages
|| right == ChatRestriction::SendVideoMessages)
? ((user->flags() & UserDataFlag::VoiceMessagesForbidden)