From b5cd44920312cf3f8b3fb582ead9a7bda85142ee Mon Sep 17 00:00:00 2001 From: dklawren Date: Fri, 3 Aug 2018 11:54:28 -0400 Subject: Bug 1479350 - "Phabricator Reviews Requested of You" lists bugs which I have reviewed --- extensions/PhabBugz/lib/Util.pm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'extensions/PhabBugz') 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; -- cgit v1.2.3-24-g4f1b