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

Mark [un]read from chats list.

This commit is contained in:
John Preston
2018-06-26 19:03:45 +01:00
parent 372cf275e0
commit 35c759c6bc
15 changed files with 196 additions and 33 deletions

View File

@@ -1275,10 +1275,6 @@ Dialogs::IndexedList *MainWidget::contactsNoDialogsList() {
return _dialogs->contactsNoDialogsList();
}
void MainWidget::unreadCountChanged(not_null<History*> history) {
_history->unreadCountChanged(history);
}
TimeMs MainWidget::highlightStartTime(not_null<const HistoryItem*> item) const {
return _history->highlightStartTime(item);
}
@@ -4634,8 +4630,14 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
case mtpc_updateDialogUnreadMark: {
const auto &data = update.c_updateDialogUnreadMark();
if (data.is_unread()) {
// #TODO dialog_unread
const auto history = data.vpeer.match(
[&](const MTPDdialogPeer &data) {
const auto peerId = peerFromMTP(data.vpeer);
return App::historyLoaded(peerId);
//}, [&](const MTPDdialogPeerFeed &data) { // #feed
});
if (history) {
history->setUnreadMark(data.is_unread());
}
} break;