2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Track inbox/outbox comments/replies read state.

This commit is contained in:
John Preston
2020-09-22 14:01:49 +03:00
parent e021e0beb3
commit 13ad590a51
10 changed files with 257 additions and 192 deletions

View File

@@ -238,9 +238,7 @@ bool RepliesList::buildFromData(not_null<Viewer*> viewer) {
if (viewer->around != ShowAtUnreadMsgId) {
return viewer->around;
} else if (const auto item = lookupRoot()) {
if (const auto original = item->lookupDiscussionPostOriginal()) {
return original->computeCommentsReadTillFull();
}
return item->computeRepliesInboxReadTillFull();
}
return viewer->around;
}();
@@ -565,11 +563,16 @@ bool RepliesList::processMessagesIsEmpty(const MTPmessages_Messages &result) {
_fullCount = checkedCount;
if (const auto item = lookupRoot()) {
if (_skippedAfter == 0) {
item->setRepliesMaxId(_list.front());
} else {
item->setRepliesPossibleMaxId(maxId);
}
if (const auto original = item->lookupDiscussionPostOriginal()) {
if (_skippedAfter == 0) {
original->setCommentsMaxId(_list.front());
original->setRepliesMaxId(_list.front());
} else {
original->setCommentsPossibleMaxId(maxId);
original->setRepliesPossibleMaxId(maxId);
}
}
}