Check threads for new posts when marking them dead.

Also minor cleanup.
This commit is contained in:
ccd0 2015-05-25 23:52:36 -07:00
parent 309daf7026
commit 4dc5cc76fb

View File

@ -136,11 +136,13 @@ ThreadWatcher =
boardID = g.BOARD.ID boardID = g.BOARD.ID
db.forceSync() db.forceSync()
for threadID, data of db.data.boards[boardID] when not data?.isDead and threadID not of g.BOARD.threads 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') if Conf['Auto Prune'] or not (data and typeof data is 'object') # corrupt data
ThreadWatcher.db.delete {boardID, threadID} db.delete {boardID, threadID}
else else
if Conf['Show Unread Count']
ThreadWatcher.fetchStatus {boardID, threadID, data}
data.isDead = true data.isDead = true
ThreadWatcher.db.set {boardID, threadID, val: data} db.set {boardID, threadID, val: data}
ThreadWatcher.refresh() ThreadWatcher.refresh()
onThreadRefresh: (e) -> onThreadRefresh: (e) ->
thread = g.threads[e.detail.threadID] thread = g.threads[e.detail.threadID]