recheck threads when quoted post not found in cached data

This commit is contained in:
ccd0 2014-09-10 01:19:28 -07:00
parent e8680a5925
commit 9cdac0c9f4
2 changed files with 8 additions and 0 deletions

View File

@ -117,6 +117,13 @@ Get =
break if post.no is postID # we found it!
if post.no isnt postID
# Cached requests can be stale and must be rechecked.
if req.cached
api = "//a.4cdn.org/#{boardID}/thread/#{threadID}.json"
$.cleanCache (url) -> url is api
$.cache api, ->
Get.fetchedPost @, boardID, threadID, postID, root, context
return
# The post can be deleted by the time we check a quote.
unless Get.archivedPost boardID, postID, root, context
$.addClass root, 'warning'

View File

@ -89,6 +89,7 @@ do ->
$.on req, 'load', (e) ->
cb.call @, e for cb in @callbacks
@evt = e
@cached = true
delete @callbacks
$.on req, 'abort error', rm
req.callbacks = [cb]