2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Don't use MTP for PeerData::isSelf.

This commit is contained in:
John Preston
2021-12-01 18:51:18 +04:00
parent 8592326a3c
commit afcebb136c
6 changed files with 31 additions and 15 deletions

View File

@@ -37,6 +37,7 @@ enum class UserDataFlag {
Support = (1 << 10),
CanPinMessages = (1 << 11),
DiscardMinPhoto = (1 << 12),
Self = (1 << 13),
};
inline constexpr bool is_flag_type(UserDataFlag) { return true; };
using UserDataFlags = base::flags<UserDataFlag>;
@@ -68,21 +69,15 @@ public:
}
void setAccessHash(uint64 accessHash);
void setFlags(UserDataFlags which) {
_flags.set(which);
}
void addFlags(UserDataFlags which) {
_flags.add(which);
}
void removeFlags(UserDataFlags which) {
_flags.remove(which);
}
auto flags() const {
return _flags.current();
}
auto flagsValue() const {
return _flags.value();
}
void setFlags(UserDataFlags which);
void addFlags(UserDataFlags which);
void removeFlags(UserDataFlags which);
[[nodiscard]] bool isVerified() const {
return flags() & UserDataFlag::Verified;