From 68bd81ccde9acc06411652320ea6771871ae6783 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Wed, 5 Aug 2015 09:48:59 -0700 Subject: [PATCH] Do 404 redirect for threads left over as stubs. --- src/General/Main.coffee | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/General/Main.coffee b/src/General/Main.coffee index d4e66be15..737dda2ad 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -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',