From dc519b098fac5c18b3807e8a7dfd37334799c951 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 12 Jul 2016 14:44:03 +0000 Subject: Bug 1283649 - When an attachment is a github pull request link, the pull request diff should be displayed in the edit page --- extensions/Splinter/lib/Util.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'extensions/Splinter/lib') diff --git a/extensions/Splinter/lib/Util.pm b/extensions/Splinter/lib/Util.pm index 870e67be7..6421d2f0b 100644 --- a/extensions/Splinter/lib/Util.pm +++ b/extensions/Splinter/lib/Util.pm @@ -78,8 +78,9 @@ sub attachment_is_visible { sub attachment_id_is_patch { my $attach_id = shift; my $attachment = attachment_id_is_valid($attach_id); - - return ($attachment && $attachment->ispatch); + return ($attachment + && ($attachment->ispatch + || ($attachment->contenttype eq "text/x-github-pull-request" && $attachment->external_redirect))); } sub get_review_base { @@ -103,7 +104,7 @@ sub get_review_link { my $attachment = attachment_id_is_valid($attach_id); - if ($attachment && $attachment->ispatch) { + if (attachment_id_is_patch($attach_id)) { return "$link_text"; } -- cgit v1.2.3-24-g4f1b