From c19a1b83a93d36f592427f2f2584dab744eed3c4 Mon Sep 17 00:00:00 2001 From: evazion Date: Sat, 31 Mar 2018 17:20:20 -0500 Subject: [PATCH] Fix #3573: commentary: add source citation when fetching cross-site. --- app/assets/javascripts/artist_commentaries.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/artist_commentaries.js b/app/assets/javascripts/artist_commentaries.js index 4b72d71d7..472fbdc51 100644 --- a/app/assets/javascripts/artist_commentaries.js +++ b/app/assets/javascripts/artist_commentaries.js @@ -115,6 +115,7 @@ // If the new description conflicts with the current description, merge them // by appending the new description onto the old one. Danbooru.ArtistCommentary.merge_commentaries = function(description, commentary) { + var post_source = $('#image-container').data().source; var normalized_source = $("#image-container").data().normalizedSource; if ((commentary.original_description && description) && @@ -124,7 +125,9 @@ + "\n\nh6. " + (commentary.original_title || "Untitled") + "\n\n" + commentary.original_description + "\n\n[tn]\nSource: " + commentary.source + "\n[/tn]"; - } else { + } else if (commentary.source != post_source) { + return commentary.original_description + "\n\n[tn]\nSource: " + commentary.source + "\n[/tn]"; + } else { return commentary.original_description || description; } };