summaryrefslogtreecommitdiffstats
path: root/extensions/Splinter/Extension.pm
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/Splinter/Extension.pm')
-rw-r--r--extensions/Splinter/Extension.pm16
1 files changed, 14 insertions, 2 deletions
diff --git a/extensions/Splinter/Extension.pm b/extensions/Splinter/Extension.pm
index a3d9fe181..42a18d912 100644
--- a/extensions/Splinter/Extension.pm
+++ b/extensions/Splinter/Extension.pm
@@ -1,3 +1,10 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
package Bugzilla::Extension::Splinter;
use strict;
@@ -75,8 +82,13 @@ sub page_before_template {
}
$vars->{'attach_id'} = $attachment->id;
- $vars->{'attach_data'} = $attachment->data;
- $vars->{'attach_is_crlf'} = $attachment->{data} =~ /\012\015/ ? 1 : 0;
+ if ($user->id && $attachment->contenttype eq "text/x-github-pull-request" && $attachment->can_review) {
+ $vars->{'attach_data'} = $attachment->fetch_github_pr_diff;
+ }
+ else {
+ $vars->{'attach_data'} = $attachment->data;
+ }
+ $vars->{'attach_is_crlf'} = $vars->{'attach_data'} =~ /\012\015/ ? 1 : 0;
}
my $field_object = new Bugzilla::Field({ name => 'attachments.status' });