diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 89800ad53..9dc3f6824 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -6446,7 +6446,7 @@ return arr.splice(0, i); }, read: function(e) { - var bottom, height, i, post, posts, read, top, _ref; + var ID, bottom, height, i, post, posts, read, top, _ref; if (d.hidden || !Unread.posts.length) { return; @@ -6458,14 +6458,14 @@ while (post = posts[--i]) { _ref = post.nodes.root.getBoundingClientRect(), bottom = _ref.bottom, top = _ref.top; if ((bottom < height) && (top > 0)) { - read.push(post); + ID = post.ID; posts.remove(post); } } - if (!read.length) { + if (!ID) { return; } - Unread.lastReadPost = read[read.length - 1].ID; + Unread.lastReadPost = ID; Unread.saveLastReadPost(); Unread.readArray(Unread.postsQuotingYou); if (e) { @@ -8234,6 +8234,11 @@ if (this.thread.OP === qpost) { return; } + if (QuoteThreading.hasRun) { + if (!Unread.posts.contains(qpost)) { + return; + } + } qroot = qpost.nodes.root; threadContainer = qroot.nextSibling; if ((threadContainer != null ? threadContainer.className : void 0) !== 'threadContainer') { diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 870a7801f..62b4e306e 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -6438,7 +6438,7 @@ return arr.splice(0, i); }, read: function(e) { - var bottom, height, i, post, posts, read, top, _ref; + var ID, bottom, height, i, post, posts, read, top, _ref; if (d.hidden || !Unread.posts.length) { return; @@ -6450,14 +6450,14 @@ while (post = posts[--i]) { _ref = post.nodes.root.getBoundingClientRect(), bottom = _ref.bottom, top = _ref.top; if ((bottom < height) && (top > 0)) { - read.push(post); + ID = post.ID; posts.remove(post); } } - if (!read.length) { + if (!ID) { return; } - Unread.lastReadPost = read[read.length - 1].ID; + Unread.lastReadPost = ID; Unread.saveLastReadPost(); Unread.readArray(Unread.postsQuotingYou); if (e) { @@ -8251,6 +8251,11 @@ if (this.thread.OP === qpost) { return; } + if (QuoteThreading.hasRun) { + if (!Unread.posts.contains(qpost)) { + return; + } + } qroot = qpost.nodes.root; threadContainer = qroot.nextSibling; if ((threadContainer != null ? threadContainer.className : void 0) !== 'threadContainer') { diff --git a/builds/crx.crx b/builds/crx.crx index 340b385d7..14f54ad67 100644 Binary files a/builds/crx.crx and b/builds/crx.crx differ diff --git a/builds/crx/script.js b/builds/crx/script.js index 004512c4b..1d2ee9175 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -6359,7 +6359,7 @@ return arr.splice(0, i); }, read: function(e) { - var bottom, height, i, post, posts, read, top, _ref; + var ID, bottom, height, i, post, posts, read, top, _ref; if (d.hidden || !Unread.posts.length) { return; @@ -6371,14 +6371,14 @@ while (post = posts[--i]) { _ref = post.nodes.root.getBoundingClientRect(), bottom = _ref.bottom, top = _ref.top; if ((bottom < height) && (top > 0)) { - read.push(post); + ID = post.ID; posts.remove(post); } } - if (!read.length) { + if (!ID) { return; } - Unread.lastReadPost = read[read.length - 1].ID; + Unread.lastReadPost = ID; Unread.saveLastReadPost(); Unread.readArray(Unread.postsQuotingYou); if (e) { @@ -8153,6 +8153,11 @@ if (this.thread.OP === qpost) { return; } + if (QuoteThreading.hasRun) { + if (!Unread.posts.contains(qpost)) { + return; + } + } qroot = qpost.nodes.root; threadContainer = qroot.nextSibling; if ((threadContainer != null ? threadContainer.className : void 0) !== 'threadContainer') { diff --git a/src/code/monitoring/unread.coffee b/src/code/monitoring/unread.coffee index 3b1f404bd..53368f1af 100644 --- a/src/code/monitoring/unread.coffee +++ b/src/code/monitoring/unread.coffee @@ -108,11 +108,11 @@ Unread = while post = posts[--i] {bottom, top} = post.nodes.root.getBoundingClientRect() if (bottom < height) and (top > 0) # post is completely read - read.push post + ID = post.ID posts.remove post - return unless read.length + return unless ID - Unread.lastReadPost = read[read.length - 1].ID + Unread.lastReadPost = ID Unread.saveLastReadPost() Unread.readArray Unread.postsQuotingYou Unread.update() if e diff --git a/src/code/quoting/quotethreading.coffee b/src/code/quoting/quotethreading.coffee index 81a9d19b3..0b0b59c43 100644 --- a/src/code/quoting/quotethreading.coffee +++ b/src/code/quoting/quotethreading.coffee @@ -70,6 +70,9 @@ QuoteThreading = delete @cb return if @thread.OP is qpost + + if QuoteThreading.hasRun + return unless Unread.posts.contains qpost qroot = qpost.nodes.root threadContainer = qroot.nextSibling