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

Support pinned chats in folders.

This commit is contained in:
John Preston
2019-04-19 12:47:49 +04:00
parent 607655941d
commit 58519300ea
23 changed files with 564 additions and 304 deletions

View File

@@ -247,7 +247,11 @@ DialogsWidget::DialogsWidget(QWidget *parent, not_null<Window::Controller*> cont
&& !_searchFullMigrated))) {
onSearchMore();
} else {
session().api().requestDialogs();
const auto folder = _inner->shownFolder();
const auto folderId = folder ? folder->id() : FolderId(0);
if (!folderId || !folder->chatsListLoaded()) {
session().api().requestDialogs(folderId);
}
}
});
_inner->listBottomReached(
@@ -1063,14 +1067,6 @@ void DialogsWidget::onListScroll() {
// Fix button rendering glitch, Qt bug with WA_OpaquePaintEvent widgets.
_scrollToTop->update();
if (const auto folder = _inner->shownFolder()) {
if (!folder->chatsListLoaded()
&& (scrollTop + height() * PreloadHeightsCount
>= _scroll->scrollTopMax())) {
session().api().requestFolderDialogs(folder->id());
}
}
}
void DialogsWidget::applyFilterUpdate(bool force) {