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

Method prepare

Telegram/SourceFiles/boxes/premium_limits_box.cpp:222–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222void InactiveController::prepare() {
223 _requestId = _session->api().request(MTPchannels_GetInactiveChannels(
224 )).done([=](const MTPmessages_InactiveChats &result) {
225 _requestId = 0;
226 const auto &data = result.data();
227 _session->data().processUsers(data.vusers());
228 const auto &list = data.vchats().v;
229 const auto &dates = data.vdates().v;
230 for (auto i = 0, count = int(list.size()); i != count; ++i) {
231 const auto peer = _session->data().processChat(list[i]);
232 const auto date = (i < dates.size()) ? dates[i].v : TimeId();
233 appendRow(peer, date);
234 }
235 delegate()->peerListRefreshRows();
236 _count = delegate()->peerListFullRowsCount();
237 }).send();
238}
239
240void InactiveController::rowClicked(not_null<PeerListRow*> row) {
241 delegate()->peerListSetRowChecked(row, !row->checked());

Callers

nothing calls this directly

Calls 15

MTP_flagsFunction · 0.85
apiMethod · 0.80
processUsersMethod · 0.80
processChatMethod · 0.80
isChannelMethod · 0.80
sendMethod · 0.45
doneMethod · 0.45
requestMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
peerListRefreshRowsMethod · 0.45
peerListFullRowsCountMethod · 0.45

Tested by

no test coverage detected