From bd5ae5e8e17f448e77766bbb1fdd09ba5e9230ec Mon Sep 17 00:00:00 2001 From: David Walsh Date: Wed, 19 Jul 2017 14:06:36 -0500 Subject: Bug 1374396 - Add initial push connector for Phabricator --- extensions/Push/lib/Connector/Phabricator.pm | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'extensions/Push/lib') diff --git a/extensions/Push/lib/Connector/Phabricator.pm b/extensions/Push/lib/Connector/Phabricator.pm index 89ca41a2d..5c9cabe8b 100644 --- a/extensions/Push/lib/Connector/Phabricator.pm +++ b/extensions/Push/lib/Connector/Phabricator.pm @@ -37,25 +37,13 @@ sub should_send { return 0 unless Bugzilla->params->{phabricator_enabled}; - if (!( $message->routing_key - =~ /^(?:attachment|bug)\.modify:.*\bbug_group\b/ - ) - ) - { - return 0; - } + return 0 unless $message->routing_key =~ /^(?:attachment|bug)\.modify:.*\bbug_group\b/; my $data = $message->payload_decoded; my $bug_data = $self->_get_bug_data($data) || return 0; my $bug = Bugzilla::Bug->new( { id => $bug_data->{id}, cache => 1 } ); - my $has_phab_stub_attachment - = $bug->has_attachment_with_mimetype(PHAB_CONTENT_TYPE); - - if ($has_phab_stub_attachment) { - return 1; - } - return 0; + return $bug->has_attachment_with_mimetype(PHAB_CONTENT_TYPE); } sub send { -- cgit v1.2.3-24-g4f1b