Add threadID and boardID to regular post object to make it more compatible with Build.parseJSON output.

This commit is contained in:
ccd0 2016-10-01 17:46:32 -07:00
parent 34534985e3
commit 8c6424f512
2 changed files with 6 additions and 5 deletions

View File

@ -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

View File

@ -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