2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-03 16:15:13 +00:00

unread loading by inboxReadBefore message id added

This commit is contained in:
John Preston
2015-09-08 16:34:22 +03:00
parent 54d5b6dd71
commit 8ff20d759b
7 changed files with 83 additions and 48 deletions

View File

@@ -1446,9 +1446,18 @@ bool History::loadedAtTop() const {
bool History::isReadyFor(MsgId msgId, bool check) const {
if (msgId == ShowAtTheEndMsgId) {
return loadedAtBottom();
} else if (msgId == ShowAtUnreadMsgId) {
return check ? (loadedAtBottom() && (msgCount >= unreadCount)) : !isEmpty();
} else if (check) {
if (msgId == ShowAtUnreadMsgId) {
if (unreadCount) {
if (!isEmpty()) {
return (loadedAtTop() || minMsgId() <= inboxReadBefore) && (loadedAtBottom() || maxMsgId() >= inboxReadBefore);
} else {
return false;
}
} else {
return loadedAtBottom();
}
}
HistoryItem *item = App::histItemById(channelId(), msgId);
return item && item->history() == this && !item->detached();
}