2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 00:46:08 +00:00

Count unread correctly in folders.

This commit is contained in:
John Preston
2019-04-22 18:22:39 +04:00
parent 58519300ea
commit 8fd811517b
23 changed files with 673 additions and 798 deletions

View File

@@ -248,9 +248,8 @@ DialogsWidget::DialogsWidget(QWidget *parent, not_null<Window::Controller*> cont
onSearchMore();
} else {
const auto folder = _inner->shownFolder();
const auto folderId = folder ? folder->id() : FolderId(0);
if (!folderId || !folder->chatsListLoaded()) {
session().api().requestDialogs(folderId);
if (!folder || !folder->chatsListLoaded()) {
session().api().requestDialogs(folder);
}
}
});
@@ -378,13 +377,13 @@ void DialogsWidget::activate() {
}
void DialogsWidget::refreshDialog(Dialogs::Key key) {
const auto creating = !key.entry()->inChatList(Dialogs::Mode::All);
const auto creating = !key.entry()->inChatList();
_inner->refreshDialog(key);
const auto history = key.history();
if (creating && history && history->peer->migrateFrom()) {
if (const auto migrated = history->owner().historyLoaded(
history->peer->migrateFrom())) {
if (migrated->inChatList(Dialogs::Mode::All)) {
if (migrated->inChatList()) {
_inner->removeDialog(migrated);
}
}