mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 22:16:14 +00:00
Don't use MTP for PeerData::isSelf.
This commit is contained in:
@@ -25,7 +25,8 @@ using UpdateFlag = Data::PeerUpdate::Flag;
|
||||
} // namespace
|
||||
|
||||
UserData::UserData(not_null<Data::Session*> owner, PeerId id)
|
||||
: PeerData(owner, id) {
|
||||
: PeerData(owner, id)
|
||||
, _flags((id == owner->session().userPeerId()) ? Flag::Self : Flag(0)) {
|
||||
}
|
||||
|
||||
bool UserData::canShareThisContact() const {
|
||||
@@ -173,6 +174,19 @@ void UserData::setAccessHash(uint64 accessHash) {
|
||||
}
|
||||
}
|
||||
|
||||
void UserData::setFlags(UserDataFlags which) {
|
||||
_flags.set((flags() & UserDataFlag::Self)
|
||||
| (which & ~UserDataFlag::Self));
|
||||
}
|
||||
|
||||
void UserData::addFlags(UserDataFlags which) {
|
||||
_flags.add(which & ~UserDataFlag::Self);
|
||||
}
|
||||
|
||||
void UserData::removeFlags(UserDataFlags which) {
|
||||
_flags.remove(which & ~UserDataFlag::Self);
|
||||
}
|
||||
|
||||
void UserData::setCallsStatus(CallsStatus callsStatus) {
|
||||
if (callsStatus != _callsStatus) {
|
||||
_callsStatus = callsStatus;
|
||||
|
Reference in New Issue
Block a user