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

Update API scheme to layer 119. Count replies.

This commit is contained in:
John Preston
2020-09-01 10:44:18 +04:00
parent fcdc4cd465
commit 55edb3bdfe
54 changed files with 973 additions and 583 deletions

View File

@@ -815,6 +815,28 @@ bool PeerData::canSendPolls() const {
return false;
}
void PeerData::setIsBlocked(bool is) {
const auto status = is
? BlockStatus::Blocked
: BlockStatus::NotBlocked;
if (_blockStatus != status) {
_blockStatus = status;
if (const auto user = asUser()) {
const auto flags = user->fullFlags();
if (is) {
user->setFullFlags(flags | MTPDuserFull::Flag::f_blocked);
} else {
user->setFullFlags(flags & ~MTPDuserFull::Flag::f_blocked);
}
}
session().changes().peerUpdated(this, UpdateFlag::IsBlocked);
}
}
void PeerData::setLoadedStatus(LoadedStatus status) {
_loadedStatus = status;
}
namespace Data {
std::vector<ChatRestrictions> ListOfRestrictions() {