MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / setIsBlocked

Method setIsBlocked

Telegram/SourceFiles/data/data_peer.cpp:2142–2159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2140}
2141
2142void PeerData::setIsBlocked(bool is) {
2143 const auto status = is
2144 ? BlockStatus::Blocked
2145 : BlockStatus::NotBlocked;
2146 if (_blockStatus != status) {
2147 _blockStatus = status;
2148 if (const auto user = asUser()) {
2149 const auto flags = user->flags();
2150 if (is) {
2151 user->setFlags(flags | UserDataFlag::Blocked);
2152 } else {
2153 user->setFlags(flags & ~UserDataFlag::Blocked);
2154 }
2155 }
2156 session().changes().peerUpdated(this, UpdateFlag::IsBlocked);
2157 Core::App().notifications().checkDelayed();
2158 }
2159}
2160
2161void PeerData::setLoadedStatus(LoadedStatus status) {
2162 _loadedStatus = status;

Callers 5

ApplyUserUpdateFunction · 0.80
applySliceMethod · 0.80
blockMethod · 0.80
unblockMethod · 0.80
feedUpdateMethod · 0.80

Calls 6

AppClass · 0.85
peerUpdatedMethod · 0.80
flagsMethod · 0.45
setFlagsMethod · 0.45
changesMethod · 0.45
checkDelayedMethod · 0.45

Tested by

no test coverage detected