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

Add read status tracking to comments.

This commit is contained in:
John Preston
2020-09-08 14:19:44 +03:00
parent 78d83a2c69
commit b8424b1d89
11 changed files with 182 additions and 11 deletions

View File

@@ -165,7 +165,14 @@ bool RepliesList::buildFromData(not_null<Viewer*> viewer) {
= 0;
return true;
}
const auto around = viewer->around;
const auto around = [&] {
if (viewer->around != ShowAtUnreadMsgId) {
return viewer->around;
} else if (const auto item = lookupRoot()) {
return item->repliesReadTill();
}
return viewer->around;
}();
if (_list.empty()
|| (!around && _skippedAfter != 0)
|| (around > _list.front() && _skippedAfter != 0)
@@ -251,6 +258,10 @@ Histories &RepliesList::histories() {
return _history->owner().histories();
}
HistoryItem *RepliesList::lookupRoot() {
return _history->owner().message(_history->channelId(), _rootId);
}
void RepliesList::loadAround(MsgId id) {
if (_loadingAround && *_loadingAround == id) {
return;