Merge pull request #3054 from matrix-org/jryans/unread-room-coomments

Fix comments in unread room tracking
This commit is contained in:
J. Ryan Stinnett 2019-06-03 17:48:03 +01:00 committed by GitHub
commit 42c8a9b5f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,20 +70,20 @@ module.exports = {
const ev = room.timeline[i]; const ev = room.timeline[i];
if (ev.getId() == readUpToId) { if (ev.getId() == readUpToId) {
// If we've read up to this event, there's nothing more recents // If we've read up to this event, there's nothing more recent
// that counts and we can stop looking because the user's read // that counts and we can stop looking because the user's read
// this and everything before. // this and everything before.
return false; return false;
} else if (!shouldHideEvent(ev) && this.eventTriggersUnreadCount(ev)) { } else if (!shouldHideEvent(ev) && this.eventTriggersUnreadCount(ev)) {
// We've found a message that counts before we hit // We've found a message that counts before we hit
// the read marker, so this room is definitely unread. // the user's read receipt, so this room is definitely unread.
return true; return true;
} }
} }
// If we got here, we didn't find a message that counted but didn't // If we got here, we didn't find a message that counted but didn't find
// find the read marker either, so we guess and say that the room // the user's read receipt either, so we guess and say that the room is
// is unread on the theory that false positives are better than // unread on the theory that false positives are better than false
// false negatives here. // negatives here.
return true; return true;
}, },
}; };