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

Correctly apply photos from "min" users.

This commit is contained in:
John Preston
2021-09-09 16:59:36 +03:00
parent 54e76c0b71
commit 28be89f7c3
2 changed files with 7 additions and 1 deletions

View File

@@ -36,6 +36,7 @@ enum class UserDataFlag {
PhoneCallsPrivate = (1 << 9),
Support = (1 << 10),
CanPinMessages = (1 << 11),
DiscardMinPhoto = (1 << 12),
};
inline constexpr bool is_flag_type(UserDataFlag) { return true; };
using UserDataFlags = base::flags<UserDataFlag>;
@@ -108,6 +109,9 @@ public:
// Duplicated in Data::CanWriteValue().
return !isInaccessible() && !isRepliesChat();
}
[[nodiscard]] bool applyMinPhoto() const {
return !(flags() & UserDataFlag::DiscardMinPhoto);
}
[[nodiscard]] bool canShareThisContact() const;
[[nodiscard]] bool canAddContact() const {