From e2a55997ce2361786bc068ced57c4055e1c613dc Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 18 Jul 2015 10:25:38 -0700 Subject: [PATCH] Implement archive redirect for 'imgboard.php?res=' URLs. --- src/General/Main.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 2072ce95c..ee55361fb 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -75,6 +75,13 @@ Main = when 'sys.4chan.org' Report.init() PostSuccessful.init() if g.VIEW is 'post' + if /\/imgboard\.php$/.test(location.pathname) and (match = location.search.match /\bres=(\d+)/) + $.ready -> + if $.id('errmsg')?.textContent is 'Error: Specified thread does not exist.' + Redirect.init() + Redirect.navigate Redirect.to 'thread', + boardID: g.BOARD.ID + postID: +match[1] return when 'i.4cdn.org' $.asap (-> d.readyState isnt 'loading'), ->