From ecead5f7e83a6b48c81ca1b492531cdcba9e6523 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 9 Mar 2015 19:58:15 -0700 Subject: [PATCH] Index should also rebuild posts from quote fetching. As was done for thread expansion in 184141a5e0c5c1da2ac85c8d0c550bfb24b02577. --- src/Filtering/ThreadHiding.coffee | 9 ++++++--- src/General/Build.coffee | 5 ++++- src/General/Index.coffee | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Filtering/ThreadHiding.coffee b/src/Filtering/ThreadHiding.coffee index 06af56757..e8fb10969 100755 --- a/src/Filtering/ThreadHiding.coffee +++ b/src/Filtering/ThreadHiding.coffee @@ -4,7 +4,7 @@ ThreadHiding = @db = new DataBoard 'hiddenThreads' return @catalogWatch() if g.VIEW is 'catalog' @catalogSet g.BOARD - Thread.callbacks.push + Post.callbacks.push name: 'Thread Hiding' cb: @node @@ -38,10 +38,13 @@ ThreadHiding = ThreadHiding.hiddenThreads = hiddenThreads2 node: -> + return if @isReply or @isClone or @isFetchedQuote + if data = ThreadHiding.db.get {boardID: @board.ID, threadID: @ID} - ThreadHiding.hide @, data.makeStub + ThreadHiding.hide @thread, data.makeStub + return unless Conf['Thread Hiding Buttons'] - $.prepend @OP.nodes.root, ThreadHiding.makeButton @, 'hide' + $.prepend @nodes.root, ThreadHiding.makeButton(@thread, 'hide') onIndexBuild: (nodes) -> for root in nodes diff --git a/src/General/Build.coffee b/src/General/Build.coffee index ab1214605..7be733988 100755 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -276,7 +276,10 @@ Build = thread: (board, data, full) -> Build.spoilerRange[board] = data.custom_spoiler - if (OP = board.posts[data.no]) and root = OP.nodes.root.parentNode + if OP = board.posts[data.no] + OP = null if OP.isFetchedQuote + + if OP and (root = OP.nodes.root.parentNode) $.rmAll root else root = $.el 'div', diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 213b01d2f..d1a8f5073 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -517,7 +517,7 @@ Index = thread = new Thread threadData.no, g.BOARD threads.push thread Index.nodes.push threadRoot - unless thread.ID of thread.posts + unless thread.OP and not thread.OP.isFetchedQuote posts.push new Post $('.opContainer', threadRoot), thread, g.BOARD thread.setPage i // Index.threadsNumPerPage + 1 catch err @@ -543,7 +543,7 @@ Index = continue unless lastReplies = Index.liveThreadData[i].last_replies nodes = [] for data in lastReplies - if post = thread.posts[data.no] + if (post = thread.posts[data.no]) and not post.isFetchedQuote nodes.push post.nodes.root continue nodes.push node = Build.postFromObject data, thread.board.ID