mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 21:10:56 +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:
parent
a7e4b846d6
commit
091beee730
1 changed files with 17 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue