2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Move chats / contacts lists to Data::Session.

This commit is contained in:
John Preston
2019-04-16 18:05:56 +04:00
parent 2862070348
commit 0c0d6bc411
25 changed files with 441 additions and 496 deletions

View File

@@ -258,8 +258,8 @@ void ChatsListBoxController::rebuildRows() {
++added;
}
}
added += appendList(App::main()->dialogsList());
added += appendList(App::main()->contactsNoDialogsList());
added += appendList(Auth().data().chatsList());
added += appendList(Auth().data().contactsNoChatsList());
if (!wasEmpty && added > 0) {
// Place dialogs list before contactsNoDialogs list.
delegate()->peerListPartitionRows([](const PeerListRow &a) {
@@ -327,7 +327,7 @@ void ContactsBoxController::prepare() {
}
void ContactsBoxController::rebuildRows() {
auto appendList = [this](auto chats) {
const auto appendList = [&](auto chats) {
auto count = 0;
for (const auto row : chats->all()) {
if (const auto history = row->history()) {
@@ -340,7 +340,7 @@ void ContactsBoxController::rebuildRows() {
}
return count;
};
appendList(App::main()->contactsList());
appendList(Auth().data().contactsList());
checkForEmptyRows();
delegate()->peerListRefreshRows();
}