From 509156a95667f4b835808d9f1d804741b425a753 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Sun, 26 Jan 2014 20:29:21 +0100 Subject: [PATCH] Don't use the IndexBuild event for hiding threads. --- src/Filtering/ThreadHiding.coffee | 6 +++--- src/General/Index.coffee | 2 +- src/Monitoring/ThreadWatcher.coffee | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Filtering/ThreadHiding.coffee b/src/Filtering/ThreadHiding.coffee index 6d5635201..b0ed6c60c 100644 --- a/src/Filtering/ThreadHiding.coffee +++ b/src/Filtering/ThreadHiding.coffee @@ -4,7 +4,7 @@ ThreadHiding = @db = new DataBoard 'hiddenThreads' @syncCatalog() - $.on d, 'IndexBuild', @onIndexBuild + $.on d, 'IndexRefresh', @onIndexRefresh Thread.callbacks.push name: 'Thread Hiding' cb: @node @@ -15,8 +15,8 @@ ThreadHiding = return unless Conf['Thread Hiding'] $.prepend @OP.nodes.root, ThreadHiding.makeButton @, 'hide' - onIndexBuild: ({detail: nodes}) -> - for root, i in nodes by 2 + onIndexRefresh: -> + for root, i in Index.nodes by 2 thread = Get.threadFromRoot root continue unless thread.isHidden unless thread.stub diff --git a/src/General/Index.coffee b/src/General/Index.coffee index b86aa8ce2..8b5a42320 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -390,8 +390,8 @@ Index = nodes = Index.sortedNodes $.rmAll Index.root Index.buildReplies nodes if Conf['Show Replies'] and Conf['Index Mode'] isnt 'catalog' - $.event 'IndexBuild', nodes $.add Index.root, nodes + $.event 'IndexBuild', nodes isSearching: false clearSearch: -> diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 3eac7ae4c..ab570ebb0 100644 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -72,9 +72,8 @@ ThreadWatcher = else if Conf['Auto Watch Reply'] ThreadWatcher.add board.threads[threadID] onIndexRefresh: -> - {db} = ThreadWatcher boardID = g.BOARD.ID - for threadID, data of db.data.boards[boardID] when not data.isDead and threadID not of g.BOARD.threads + for threadID, data of ThreadWatcher.db.data.boards[boardID] when not data.isDead and threadID not of g.BOARD.threads if Conf['Auto Prune'] ThreadWatcher.db.delete {boardID, threadID} else