2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Show unread archive chat names in bold.

This commit is contained in:
John Preston
2019-05-08 12:05:15 +03:00
parent e55e46a0f0
commit 64dd5139da
4 changed files with 38 additions and 14 deletions

View File

@@ -102,7 +102,6 @@ void Folder::indexNameParts() {
}
void Folder::registerOne(not_null<History*> history) {
++_chatListViewVersion;
if (_chatsList.indexed()->size() == 1) {
updateChatListSortPosition();
if (!_cloudUnread.known) {
@@ -118,9 +117,6 @@ void Folder::registerOne(not_null<History*> history) {
void Folder::unregisterOne(not_null<History*> history) {
if (_chatsList.empty()) {
updateChatListExistence();
} else {
++_chatListViewVersion;
updateChatListEntry();
}
if (_chatListMessage && _chatListMessage->history() == history) {
computeChatListMessage();
@@ -360,6 +356,13 @@ void Folder::unreadStateChanged(
const Dialogs::Key &key,
const Dialogs::UnreadState &wasState,
const Dialogs::UnreadState &nowState) {
if (const auto history = key.history()) {
if (wasState.empty() != nowState.empty()) {
++_chatListViewVersion;
updateChatListEntry();
}
}
const auto updateCloudUnread = _cloudUnread.known && wasState.known;
const auto notify = _chatsList.loaded() || updateCloudUnread;
const auto notifier = unreadStateChangeNotifier(notify);