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

Don't use MTP* for UserData flags.

This commit is contained in:
John Preston
2021-07-08 14:19:12 +03:00
parent 2ffda9f240
commit e34375405e
11 changed files with 116 additions and 94 deletions

View File

@@ -498,7 +498,7 @@ QString PeerData::computeUnavailableReason() const {
// This is duplicated in CanPinMessagesValue().
bool PeerData::canPinMessages() const {
if (const auto user = asUser()) {
return user->fullFlags() & MTPDuserFull::Flag::f_can_pin_message;
return user->flags() & UserDataFlag::CanPinMessages;
} else if (const auto chat = asChat()) {
return chat->amIn()
&& !chat->amRestricted(ChatRestriction::PinMessages);
@@ -1000,11 +1000,11 @@ void PeerData::setIsBlocked(bool is) {
if (_blockStatus != status) {
_blockStatus = status;
if (const auto user = asUser()) {
const auto flags = user->fullFlags();
const auto flags = user->flags();
if (is) {
user->setFullFlags(flags | MTPDuserFull::Flag::f_blocked);
user->setFlags(flags | UserDataFlag::Blocked);
} else {
user->setFullFlags(flags & ~MTPDuserFull::Flag::f_blocked);
user->setFlags(flags & ~UserDataFlag::Blocked);
}
}
session().changes().peerUpdated(this, UpdateFlag::IsBlocked);