summaryrefslogtreecommitdiffstats
path: root/extensions/Review
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-12-06 18:28:00 +0100
committerByron Jones <bjones@mozilla.com>2013-12-06 18:28:00 +0100
commitce665b1f88150f437c7bb893bf3ebeabc3f04f07 (patch)
treef28bd6e20fc74672c4a10d6eec2eac2aec719065 /extensions/Review
parent07f5353454ce64657544640eca84dd06769dd8a3 (diff)
downloadbugzilla-ce665b1f88150f437c7bb893bf3ebeabc3f04f07.tar.gz
bugzilla-ce665b1f88150f437c7bb893bf3ebeabc3f04f07.tar.xz
Bug 869989: Add X-Bugzilla-Mentors field to bugmail headers and an indication to mentors in bugmail body
Diffstat (limited to 'extensions/Review')
-rw-r--r--extensions/Review/Extension.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/extensions/Review/Extension.pm b/extensions/Review/Extension.pm
index 0aa21ad5b..f15bdc9ef 100644
--- a/extensions/Review/Extension.pm
+++ b/extensions/Review/Extension.pm
@@ -33,6 +33,7 @@ BEGIN {
*Bugzilla::Component::reviewers = \&_component_reviewers;
*Bugzilla::Component::reviewers_objs = \&_component_reviewers_objs;
*Bugzilla::Bug::mentors = \&_bug_mentors;
+ *Bugzilla::Bug::is_mentor = \&_bug_is_mentor;
*Bugzilla::User::review_count = \&_user_review_count;
}
@@ -103,6 +104,12 @@ sub _bug_mentors {
return $self->{mentors};
}
+sub _bug_is_mentor {
+ my ($self, $user) = @_;
+ my $user_id = ($user || Bugzilla->user)->id;
+ return (grep { $_->id == $user_id} @{ $self->mentors }) ? 1 : 0;
+}
+
sub _user_review_count {
my ($self) = @_;
if (!exists $self->{review_count}) {