Recognize archived threads on kissu.moe as threads.

This commit is contained in:
ccd0 2019-10-21 20:54:51 -07:00
parent ad042f29e4
commit 334f7e2a52
2 changed files with 7 additions and 1 deletions

View File

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

View File

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