From 8c6424f51232da6a4714eef9863b9e14b3a15354 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 1 Oct 2016 17:46:32 -0700 Subject: [PATCH] Add threadID and boardID to regular post object to make it more compatible with Build.parseJSON output. --- src/Filtering/Filter.coffee | 3 +-- src/classes/Post.coffee | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee index 2a5ebd389..861c68630 100644 --- a/src/Filtering/Filter.coffee +++ b/src/Filtering/Filter.coffee @@ -109,10 +109,9 @@ Filter = test: (post, hideable=true) -> hl = undefined top = false - boardID = if post.board then post.board.ID else post.boardID for key of Filter.filters when ((value = Filter[key] post)?) # Continue if there's nothing to filter (no tripcode for example). - for filter in Filter.filters[key] when (result = filter value, boardID, post.isReply) + for filter in Filter.filters[key] when (result = filter value, post.boardID, post.isReply) {hide, stub} = result if hide return {hide, stub} if hideable diff --git a/src/classes/Post.coffee b/src/classes/Post.coffee index cbe3a51b4..fd251bd40 100644 --- a/src/classes/Post.coffee +++ b/src/classes/Post.coffee @@ -6,9 +6,11 @@ class Post @normalizedOriginal = Build.Test.normalize root <% } %> - @ID = +root.id[2..] - @fullID = "#{@board}.#{@ID}" - @context = @ + @ID = +root.id[2..] + @threadID = @thread.ID + @boardID = @board.ID + @fullID = "#{@board}.#{@ID}" + @context = @ root.dataset.fullID = @fullID