From 091beee7307acbb9e1e4b5b811f9ddf52b283039 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 27 Jul 2013 16:33:47 -0700 Subject: [PATCH] Don't publish Differential "create" action to Asana Summary: Ref T2852. Currently there's effectively a double notification: one for creating the task, and one for the "alincoln created this revision" story. Drop the "create" story. Test Plan: Used `bin/feed republish` to republish "create" and non-"create" stories. Verified "create" was dropped as unsupported, while non-"create" went through. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2852 Differential Revision: https://secure.phabricator.com/D6589 --- ...ialDoorkeeperRevisionFeedStoryPublisher.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php b/src/applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php index e02f368113..d11e73dc78 100644 --- a/src/applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php +++ b/src/applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php @@ -4,7 +4,23 @@ final class DifferentialDoorkeeperRevisionFeedStoryPublisher extends DoorkeeperFeedStoryPublisher { public function canPublishStory(PhabricatorFeedStory $story, $object) { - return ($object instanceof DifferentialRevision); + if (!($object instanceof DifferentialRevision)) { + return false; + } + + // Don't publish the "create" story, since pushing the object into Asana + // naturally generates a notification which effectively serves the same + // purpose as the "create" story. + + $action = $story->getStoryData()->getValue('action'); + switch ($action) { + case DifferentialAction::ACTION_CREATE: + return false; + default: + break; + } + + return true; } public function willPublishStory($object) {