From 334f7e2a521470b7050396d56b3bbd10f24f8ad3 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 21 Oct 2019 20:54:51 -0700 Subject: [PATCH] Recognize archived threads on kissu.moe as threads. --- src/classes/Post.coffee | 3 ++- src/main/Main.coffee | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/classes/Post.coffee b/src/classes/Post.coffee index 821130a0b..62065b65a 100644 --- a/src/classes/Post.coffee +++ b/src/classes/Post.coffee @@ -23,7 +23,8 @@ class Post if not @isReply @thread.OP = @ for key in ['isSticky', 'isClosed', 'isArchived'] - @thread[key] = if (selector = g.SITE.selectors.icons[key]) then !!$(selector, @nodes.info) else false + if (selector = g.SITE.selectors.icons[key]) + @thread[key] = !!$(selector, @nodes.info) if @thread.isArchived @thread.isClosed = true @thread.kill() diff --git a/src/main/Main.coffee b/src/main/Main.coffee index 3e1de4492..53fad511a 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -145,6 +145,10 @@ Main = else if pathname[2] in ['thread', 'res'] r.VIEW = 'thread' r.threadID = r.THREADID = +pathname[3].replace(/\.\w+$/, '') + else if pathname[2] is 'archive' and pathname[3] is 'res' + r.VIEW = 'thread' + r.threadID = r.THREADID = +pathname[4].replace(/\.\w+$/, '') + r.threadArchived = true else if /^(?:catalog|archive)(?:\.\w+)?$/.test(pathname[2]) r.VIEW = pathname[2].replace(/\.\w+$/, '') else if /^(?:index|\d*)(?:\.\w+)?$/.test(pathname[2]) @@ -348,6 +352,7 @@ Main = Main.handleErrors errors if errors.length if g.VIEW is 'thread' + threads[0].isArchived = true if g.threadArchived g.SITE.parseThreadMetadata?(threads[0]) Main.callbackNodes 'Thread', threads