]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1374396 - Add initial push connector for Phabricator
authorDavid Walsh <davidwalsh83@gmail.com>
Wed, 19 Jul 2017 19:06:36 +0000 (14:06 -0500)
committerDylan William Hardison <dylan@hardison.net>
Wed, 19 Jul 2017 19:06:36 +0000 (15:06 -0400)
extensions/Push/lib/Connector/Phabricator.pm

index 89ca41a2de54367131c7c23af0614ad941a3476a..5c9cabe8b54139ab0546dcd41e754950c04808b5 100644 (file)
@@ -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 {