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

Method MainList

Telegram/SourceFiles/dialogs/dialogs_main_list.cpp:19–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17namespace Dialogs {
18
19MainList::MainList(
20 not_null<Main::Session*> session,
21 FilterId filterId,
22 rpl::producer<int> pinnedLimit)
23: _filterId(filterId)
24, _all(SortMode::Date, filterId)
25, _pinned(filterId, 1) {
26 _unreadState.known = true;
27
28 std::move(
29 pinnedLimit
30 ) | rpl::on_next([=](int limit) {
31 _pinned.setLimit(std::max(limit, 1));
32 }, _lifetime);
33
34 session->changes().realtimeNameUpdates(
35 ) | rpl::on_next([=](const Data::NameUpdate &update) {
36 _all.peerNameChanged(_filterId, update.peer, update.oldFirstLetters);
37 }, _lifetime);
38}
39
40bool MainList::empty() const {
41 return _all.empty();

Callers

nothing calls this directly

Calls 4

realtimeNameUpdatesMethod · 0.80
peerNameChangedMethod · 0.80
setLimitMethod · 0.45
changesMethod · 0.45

Tested by

no test coverage detected