1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 13:30:55 +01:00

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
This commit is contained in:
epriestley 2013-07-27 16:33:47 -07:00
parent a7e4b846d6
commit 091beee730

View file

@ -4,7 +4,23 @@ final class DifferentialDoorkeeperRevisionFeedStoryPublisher
extends DoorkeeperFeedStoryPublisher { extends DoorkeeperFeedStoryPublisher {
public function canPublishStory(PhabricatorFeedStory $story, $object) { 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) { public function willPublishStory($object) {