From 4dc5cc76fb7e90f6cdc86521aed586bed0871e23 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 25 May 2015 23:52:36 -0700 Subject: [PATCH] Check threads for new posts when marking them dead. Also minor cleanup. --- src/Monitoring/ThreadWatcher.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index d4b884a0f..c68209871 100755 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -136,11 +136,13 @@ ThreadWatcher = boardID = g.BOARD.ID db.forceSync() for threadID, data of db.data.boards[boardID] when not data?.isDead and threadID not of g.BOARD.threads - if Conf['Auto Prune'] or not (data and typeof data is 'object') - ThreadWatcher.db.delete {boardID, threadID} + if Conf['Auto Prune'] or not (data and typeof data is 'object') # corrupt data + db.delete {boardID, threadID} else + if Conf['Show Unread Count'] + ThreadWatcher.fetchStatus {boardID, threadID, data} data.isDead = true - ThreadWatcher.db.set {boardID, threadID, val: data} + db.set {boardID, threadID, val: data} ThreadWatcher.refresh() onThreadRefresh: (e) -> thread = g.threads[e.detail.threadID]