Do 404 redirect for threads left over as stubs.

This commit is contained in:
ccd0 2015-08-05 09:48:59 -07:00
parent 4a456548f6
commit 68bd81ccde

View File

@ -162,17 +162,19 @@ Main =
attributeFilter: ['href']
initReady: ->
if d.title in ['4chan - Temporarily Offline', '4chan - 404 Not Found']
if g.VIEW is 'thread'
ThreadWatcher.set404 g.BOARD.ID, g.THREADID, ->
if Conf['404 Redirect']
Redirect.navigate 'thread',
boardID: g.BOARD.ID
threadID: g.THREADID
postID: +location.hash.match /\d+/ # post number or 0
, "/#{g.BOARD}/"
# XXX Sometimes threads don't 404 but are left over as stubs containing one garbage reply post.
if g.VIEW is 'thread' and not $ '.opContainer'
ThreadWatcher.set404 g.BOARD.ID, g.THREADID, ->
if Conf['404 Redirect']
Redirect.navigate 'thread',
boardID: g.BOARD.ID
threadID: g.THREADID
postID: +location.hash.match /\d+/ # post number or 0
, "/#{g.BOARD}/"
return
return if d.title in ['4chan - Temporarily Offline', '4chan - 404 Not Found']
# 4chan Pass Link
if styleSelector = $.id 'styleSelector'
passLink = $.el 'a',