2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Improve archive chat list entry layout.

This commit is contained in:
John Preston
2019-04-23 16:29:23 +04:00
parent 2d1dcb36cb
commit 9ff02707bf
13 changed files with 291 additions and 50 deletions

View File

@@ -1375,13 +1375,17 @@ void Session::applyPinnedChats(
void Session::applyDialogs(
Data::Folder *requestFolder,
const QVector<MTPMessage> &messages,
const QVector<MTPDialog> &dialogs) {
const QVector<MTPDialog> &dialogs,
std::optional<int> count) {
App::feedMsgs(messages, NewMessageLast);
for (const auto &dialog : dialogs) {
dialog.match([&](const auto &data) {
applyDialog(requestFolder, data);
});
}
if (requestFolder && count) {
requestFolder->setCloudChatsListSize(*count);
}
}
void Session::applyDialog(
@@ -1663,7 +1667,7 @@ void Session::unreadStateChanged(
const auto nowState = key.entry()->chatListUnreadState();
if (const auto folder = key.entry()->folder()) {
folder->unreadStateChanged(wasState, nowState);
folder->unreadStateChanged(key, wasState, nowState);
} else {
_chatsList.unreadStateChanged(wasState, nowState);
}
@@ -1674,10 +1678,12 @@ void Session::unreadEntryChanged(const Dialogs::Key &key, bool added) {
Expects(key.entry()->folderKnown());
const auto state = key.entry()->chatListUnreadState();
if (const auto folder = key.entry()->folder()) {
folder->unreadEntryChanged(state, added);
} else {
_chatsList.unreadEntryChanged(state, added);
if (!state.empty()) {
if (const auto folder = key.entry()->folder()) {
folder->unreadEntryChanged(key, state, added);
} else {
_chatsList.unreadEntryChanged(state, added);
}
}
}