Don't show filtered posts in thread watcher unread count.

This commit is contained in:
ccd0 2015-04-25 11:43:12 -07:00
parent a8c544c862
commit 1e395150ba
2 changed files with 8 additions and 0 deletions

View File

@ -121,6 +121,12 @@ Filter =
if !@isReply and result.top
@thread.isOnTop = true
isHidden: (post) ->
for key of Filter.filters when (value = Filter[key] post)?
for filter in Filter.filters[key] when result = filter value, post.isReply
return true if result.hide
false
name: (post) -> post.info.name
uniqueID: (post) -> post.info.uniqueID
tripcode: (post) -> post.info.tripcode

View File

@ -214,6 +214,8 @@ ThreadWatcher =
for postObj in @response.posts
continue unless postObj.no > lastReadPost
continue if QR.db?.get {boardID, threadID, postID: postObj.no}
continue if Filter.isHidden(Build.parseJSON postObj, boardID)
unread++
continue unless QR.db and postObj.com
regexp = /<a [^>]*\bhref="(?:\/([^\/]+)\/thread\/(\d+))?(?:#p(\d+))?"/g