diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index dfd612a99..43a45630a 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -112,11 +112,7 @@ Unread = addPost: -> return if @isFetchedQuote or @isClone Unread.order.push @ - return if @ID <= Unread.lastReadPost or @isHidden or QuoteYou.db?.get { - boardID: @board.ID - threadID: @thread.ID - postID: @ID - } + return if @ID <= Unread.lastReadPost or @isHidden or QuoteYou.isYou(@) Unread.posts.add @ID Unread.addPostQuotingYou @ Unread.position ?= Unread.order[@ID] @@ -172,11 +168,7 @@ Unread = Unread.posts.delete ID Unread.postsQuotingYou.delete ID - if QuoteYou.db?.get { - boardID: data.board.ID - threadID: data.thread.ID - postID: ID - } + if QuoteYou.isYou data QuoteYou.lastRead = root Unread.position = Unread.position.next diff --git a/src/Quotelinks/QuoteBacklink.coffee b/src/Quotelinks/QuoteBacklink.coffee index 1b11de07c..6aa02c7b6 100644 --- a/src/Quotelinks/QuoteBacklink.coffee +++ b/src/Quotelinks/QuoteBacklink.coffee @@ -22,7 +22,7 @@ QuoteBacklink = cb: @secondNode firstNode: -> return if @isClone or !@quotes.length or @isRebuilt - markYours = Conf['Mark Quotes of You'] and QuoteYou.db?.get {boardID: @board.ID, threadID: @thread.ID, postID: @ID} + markYours = Conf['Mark Quotes of You'] and QuoteYou.isYou(@) a = $.el 'a', href: Build.postURL @board.ID, @thread.ID, @ID className: if @isHidden then 'filtered backlink' else 'backlink' diff --git a/src/Quotelinks/QuoteYou.coffee b/src/Quotelinks/QuoteYou.coffee index 04527e94b..d235ca617 100644 --- a/src/Quotelinks/QuoteYou.coffee +++ b/src/Quotelinks/QuoteYou.coffee @@ -31,10 +31,17 @@ QuoteYou = QuoteYou.menu.init() + isYou: (post) -> + !!QuoteYou.db?.get { + boardID: post.board.ID + threadID: post.thread.ID + postID: post.ID + } + node: -> return if @isClone - if QuoteYou.db.get {boardID: @board.ID, threadID: @thread.ID, postID: @ID} + if QuoteYou.isYou @ $.addClass @nodes.root, 'yourPost' # Stop there if there's no quotes in that post. @@ -57,7 +64,7 @@ QuoteYou = order: 12 open: (post) -> QuoteYou.menu.post = (post.origin or post) - input.checked = QuoteYou.db.get {boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID} + input.checked = QuoteYou.isYou post true toggle: ->