Don't show filtered posts in thread watcher unread count.
This commit is contained in:
parent
a8c544c862
commit
1e395150ba
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user