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

Optimize third column (create it only once).

Before historyPeer and historyPeerCanWrite were independent, so we
created a new Info section for both of them changing.

Now we use Data::CanWriteValue(peer) and rpl::flatten_latest().
This commit is contained in:
John Preston
2017-09-26 16:53:51 +03:00
parent ffc20e4492
commit 1a0e524b49
16 changed files with 363 additions and 106 deletions

View File

@@ -394,7 +394,8 @@ namespace {
data->inputUser = MTP_inputUser(d.vid, MTP_long(0));
data->setName(lang(lng_deleted), QString(), QString(), QString());
data->setPhoto(MTP_userProfilePhotoEmpty());
data->setFlags(MTPDuser_ClientFlag::f_inaccessible | 0);
//data->setFlags(MTPDuser_ClientFlag::f_inaccessible | 0);
data->setFlags(MTPDuser::Flag::f_deleted);
data->setBotInfoVersion(-1);
status = &emptyStatus;
data->contact = -1;
@@ -412,7 +413,8 @@ namespace {
wasContact = data->isContact();
if (minimal) {
auto mask = 0
| MTPDuser_ClientFlag::f_inaccessible;
//| MTPDuser_ClientFlag::f_inaccessible
| MTPDuser::Flag::f_deleted;
data->setFlags((data->flags() & ~mask) | (d.vflags.v & mask));
} else {
data->setFlags(d.vflags.v);
@@ -681,7 +683,7 @@ namespace {
}
if (d.has_banned_rights()) {
cdata->setRestrictedRights(d.vbanned_rights);
} else if (cdata->hasRestrictedRights()) {
} else if (cdata->hasRestrictions()) {
cdata->setRestrictedRights(MTP_channelBannedRights(MTP_flags(0), MTP_int(0)));
}
cdata->inputChannel = MTP_inputChannel(d.vid, d.vaccess_hash);
@@ -729,7 +731,7 @@ namespace {
if (cdata->hasAdminRights()) {
cdata->setAdminRights(MTP_channelAdminRights(MTP_flags(0)));
}
if (cdata->hasRestrictedRights()) {
if (cdata->hasRestrictions()) {
cdata->setRestrictedRights(MTP_channelBannedRights(MTP_flags(0), MTP_int(0)));
}