diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index f1f9be18e..de13bb7ed 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -3110,20 +3110,20 @@ allQuotelinksLinkingTo: function(post) { var ID, handleQuotes, quote, quotedPost, quotelinks, quoterPost, _i, _len, _ref, _ref1, _ref2; quotelinks = []; - handleQuotes = function(post) { + handleQuotes = function(post, type) { var clone, _i, _len, _ref; - quotelinks.push.apply(quotelinks, post.nodes.quotelinks); + quotelinks.push.apply(quotelinks, post.nodes[type]); _ref = post.clones; for (_i = 0, _len = _ref.length; _i < _len; _i++) { clone = _ref[_i]; - quotelinks.push.apply(quotelinks, clone.nodes.quotelinks); + quotelinks.push.apply(quotelinks, clone.nodes[type]); } }; _ref = g.posts; for (ID in _ref) { quoterPost = _ref[ID]; if (_ref1 = post.fullID, __indexOf.call(quoterPost.quotes, _ref1) >= 0) { - handleQuotes(quoterPost); + handleQuotes(quoterPost, 'quotelinks'); } } if (Conf['Quote Backlinks']) { @@ -3131,7 +3131,7 @@ for (_i = 0, _len = _ref2.length; _i < _len; _i++) { quote = _ref2[_i]; if (quotedPost = g.posts[quote]) { - handleQuotes(quotedPost); + handleQuotes(quotedPost, 'backlinks'); } } } diff --git a/builds/crx/script.js b/builds/crx/script.js index 64bb96758..423598008 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -3120,20 +3120,20 @@ allQuotelinksLinkingTo: function(post) { var ID, handleQuotes, quote, quotedPost, quotelinks, quoterPost, _i, _len, _ref, _ref1, _ref2; quotelinks = []; - handleQuotes = function(post) { + handleQuotes = function(post, type) { var clone, _i, _len, _ref; - quotelinks.push.apply(quotelinks, post.nodes.quotelinks); + quotelinks.push.apply(quotelinks, post.nodes[type]); _ref = post.clones; for (_i = 0, _len = _ref.length; _i < _len; _i++) { clone = _ref[_i]; - quotelinks.push.apply(quotelinks, clone.nodes.quotelinks); + quotelinks.push.apply(quotelinks, clone.nodes[type]); } }; _ref = g.posts; for (ID in _ref) { quoterPost = _ref[ID]; if (_ref1 = post.fullID, __indexOf.call(quoterPost.quotes, _ref1) >= 0) { - handleQuotes(quoterPost); + handleQuotes(quoterPost, 'quotelinks'); } } if (Conf['Quote Backlinks']) { @@ -3141,7 +3141,7 @@ for (_i = 0, _len = _ref2.length; _i < _len; _i++) { quote = _ref2[_i]; if (quotedPost = g.posts[quote]) { - handleQuotes(quotedPost); + handleQuotes(quotedPost, 'backlinks'); } } } diff --git a/src/General/Get.coffee b/src/General/Get.coffee index d6d752943..605a0f651 100755 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -40,23 +40,22 @@ Get = allQuotelinksLinkingTo: (post) -> # Get quotelinks & backlinks linking to the given post. quotelinks = [] - handleQuotes = (post) -> - quotelinks.push post.nodes.quotelinks... - for clone in post.clones - quotelinks.push clone.nodes.quotelinks... + handleQuotes = (post, type) -> + quotelinks.push post.nodes[type]... + quotelinks.push clone.nodes[type]... for clone in post.clones return # First: # In every posts, # if it did quote this post, # get all their backlinks. - handleQuotes quoterPost for ID, quoterPost of g.posts when post.fullID in quoterPost.quotes + handleQuotes quoterPost, 'quotelinks' for ID, quoterPost of g.posts when post.fullID in quoterPost.quotes # Second: # If we have quote backlinks: # in all posts this post quoted # and their clones, # get all of their backlinks. if Conf['Quote Backlinks'] - handleQuotes quotedPost for quote in post.quotes when quotedPost = g.posts[quote] + handleQuotes quotedPost, 'backlinks' for quote in post.quotes when quotedPost = g.posts[quote] # Third: # Filter out irrelevant quotelinks. quotelinks.filter (quotelink) ->