From 6589995e4505a09ac5fdbced7fdda51c713e8955 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 1 Dec 2014 20:30:09 -0800 Subject: [PATCH] Fix treatment of fetched deleted posts. --- src/Monitoring/Unread.coffee | 12 +++++++----- src/Quotelinks/QuoteThreading.coffee | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index b94b79a24..0f3219244 100755 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -95,9 +95,10 @@ Unread = postIDs = Unread.thread.posts.keys for i in [Unread.readCount...postIDs.length] by 1 ID = +postIDs[i] - break if ID > Unread.lastReadPost - Unread.posts.delete ID - Unread.postsQuotingYou.delete ID + unless Unread.thread.posts[ID].isFetchedQuote + break if ID > Unread.lastReadPost + Unread.posts.delete ID + Unread.postsQuotingYou.delete ID Unread.readCount++ Unread.updatePosition() @@ -185,8 +186,9 @@ Unread = postIDs = Unread.thread.posts.keys for i in [Unread.readCount...postIDs.length] by 1 ID = +postIDs[i] - break if Unread.posts.has ID - Unread.lastReadPost = ID + unless Unread.thread.posts[ID].isFetchedQuote + break if Unread.posts.has ID + Unread.lastReadPost = ID Unread.readCount++ return if Unread.thread.isDead and !Unread.thread.isArchived Unread.db.forceSync() diff --git a/src/Quotelinks/QuoteThreading.coffee b/src/Quotelinks/QuoteThreading.coffee index 106232081..8c944dc52 100755 --- a/src/Quotelinks/QuoteThreading.coffee +++ b/src/Quotelinks/QuoteThreading.coffee @@ -108,6 +108,7 @@ QuoteThreading = Unread.order = new RandomAccessList QuoteThreading.inserted = {} posts.forEach (post) -> + return if post.isFetchedQuote Unread.order.push post nodes.push post.nodes.root if post.isReply if QuoteThreading.children[post.fullID]