| 17 | namespace Dialogs { |
| 18 | |
| 19 | MainList::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 | |
| 40 | bool MainList::empty() const { |
| 41 | return _all.empty(); |
nothing calls this directly
no test coverage detected