From 1c3d4b3d916920501d9ef1f5bbd1e46798582535 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 13 Mar 2015 18:58:19 -0700 Subject: [PATCH] Resurrected posts do not belong in newPosts. --- src/Monitoring/MarkNewIPs.coffee | 6 ++++-- src/Monitoring/ThreadUpdater.coffee | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Monitoring/MarkNewIPs.coffee b/src/Monitoring/MarkNewIPs.coffee index 456658c89..e3fa25f2c 100644 --- a/src/Monitoring/MarkNewIPs.coffee +++ b/src/Monitoring/MarkNewIPs.coffee @@ -7,14 +7,15 @@ MarkNewIPs = node: -> MarkNewIPs.ipCount = @ipCount + MarkNewIPs.postCount = @posts.keys.length $.on d, 'ThreadUpdate', MarkNewIPs.onUpdate onUpdate: (e) -> - {ipCount, newPosts, deletedPosts} = e.detail + {ipCount, postCount, newPosts, deletedPosts} = e.detail return unless ipCount? switch ipCount - MarkNewIPs.ipCount - when newPosts.length + when postCount - MarkNewIPs.postCount + deletedPosts.length i = MarkNewIPs.ipCount for fullID in newPosts MarkNewIPs.markNew g.posts[fullID], ++i @@ -22,6 +23,7 @@ MarkNewIPs = for fullID in newPosts MarkNewIPs.markOld g.posts[fullID] MarkNewIPs.ipCount = ipCount + MarkNewIPs.postCount = postCount markNew: (post, ipCount) -> suffix = if (ipCount // 10) % 10 is 1 diff --git a/src/Monitoring/ThreadUpdater.coffee b/src/Monitoring/ThreadUpdater.coffee index 19d80b003..0ff209342 100755 --- a/src/Monitoring/ThreadUpdater.coffee +++ b/src/Monitoring/ThreadUpdater.coffee @@ -293,13 +293,12 @@ ThreadUpdater = # Insert new posts, not older ones. continue if ID <= lastPost - newPosts.push "#{board}.#{ID}" - # XXX Resurrect wrongly deleted posts. if (post = thread.posts[ID]) and not post.isFetchedQuote post.resurrect() continue + newPosts.push "#{board}.#{ID}" node = Build.postFromObject postObject, board.ID posts.push new Post node, thread, board # Fetching your own posts after posting