summaryrefslogtreecommitdiffstats
path: root/extensions/PhabBugz
diff options
context:
space:
mode:
authordklawren <dklawren@users.noreply.github.com>2018-08-03 17:54:28 +0200
committerGitHub <noreply@github.com>2018-08-03 17:54:28 +0200
commitb5cd44920312cf3f8b3fb582ead9a7bda85142ee (patch)
treed1e1d0feee223301e7786431b83870efe7cf0e29 /extensions/PhabBugz
parent78f92784326f23d1cb50d116d9b919f80a4e766a (diff)
downloadbugzilla-b5cd44920312cf3f8b3fb582ead9a7bda85142ee.tar.gz
bugzilla-b5cd44920312cf3f8b3fb582ead9a7bda85142ee.tar.xz
Bug 1479350 - "Phabricator Reviews Requested of You" lists bugs which I have reviewed
Diffstat (limited to 'extensions/PhabBugz')
-rw-r--r--extensions/PhabBugz/lib/Util.pm18
1 files changed, 15 insertions, 3 deletions
diff --git a/extensions/PhabBugz/lib/Util.pm b/extensions/PhabBugz/lib/Util.pm
index 99668289a..5dbe31d0e 100644
--- a/extensions/PhabBugz/lib/Util.pm
+++ b/extensions/PhabBugz/lib/Util.pm
@@ -267,15 +267,27 @@ sub get_needs_review {
},
constraints => {
reviewerPHIDs => [$phab_user->phid],
- statuses => [qw( needs-review )],
+ statuses => ["open()"],
},
- order => 'newest',
+ order => 'newest',
}
);
ThrowCodeError('phabricator_api_error', { reason => 'Malformed Response' })
unless exists $diffs->{result}{data};
- return $diffs->{result}{data};
+ my @revisions;
+ foreach my $revision ( @{ $diffs->{result}{data} } ) {
+ foreach my $reviewer ( @{ $revision->{attachments}->{reviewers}->{reviewers} } ) {
+ if ( $reviewer->{reviewerPHID} eq $phab_user->phid
+ && $reviewer->{status} =~ /^(?:added|blocking)$/ )
+ {
+ push @revisions, $revision;
+ last;
+ }
+ }
+ }
+
+ return \@revisions;
}
1;