Index: src/applications/differential/editor/DifferentialTransactionEditor.php =================================================================== --- src/applications/differential/editor/DifferentialTransactionEditor.php +++ src/applications/differential/editor/DifferentialTransactionEditor.php @@ -364,6 +364,10 @@ $diff->setRevisionID($object->getID()); $diff->save(); + + $object->setLineCount($diff->getLineCount()); + $object->setRepositoryPHID($diff->getRepositoryPHID()); + return; } Index: src/applications/differential/storage/DifferentialTransaction.php =================================================================== --- src/applications/differential/storage/DifferentialTransaction.php +++ src/applications/differential/storage/DifferentialTransaction.php @@ -87,6 +87,69 @@ return $phids; } + public function getActionName() { + switch ($this->getTransactionType()) { + case self::TYPE_INLINE: + return pht('Commented On'); + case self::TYPE_UPDATE: + return pht('Updated'); + case self::TYPE_ACTION: + $map = array( + DifferentialAction::ACTION_ACCEPT => pht('Accepted'), + DifferentialAction::ACTION_REJECT => pht('Requested Changes To'), + DifferentialAction::ACTION_RETHINK => pht('Planned Changes To'), + DifferentialAction::ACTION_ABANDON => pht('Abandoned'), + DifferentialAction::ACTION_CLOSE => pht('Closed'), + DifferentialAction::ACTION_REQUEST => pht('Requested A Review Of'), + DifferentialAction::ACTION_RESIGN => pht('Resigned From'), + DifferentialAction::ACTION_ADDREVIEWERS => pht('Added Reviewers'), + DifferentialAction::ACTION_CLAIM => pht('Commandeered'), + DifferentialAction::ACTION_REOPEN => pht('Reopened'), + ); + $name = idx($map, $this->getNewValue()); + if ($name !== null) { + return $name; + } + break; + } + + return parent::getActionName(); + } + + public function getMailTags() { + $tags = array(); + + switch ($this->getTransactionType()) { + case PhabricatorTransactions::TYPE_SUBSCRIBERS; + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_CC; + break; + case self::TYPE_ACTION: + switch ($this->getNewValue()) { + case DifferentialAction::ACTION_CLOSE: + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_CLOSED; + break; + } + break; + case PhabricatorTransactions::TYPE_EDGE: + switch ($this->getMetadataValue('edge:type')) { + case PhabricatorEdgeConfig::TYPE_DREV_HAS_REVIEWER: + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEWERS; + break; + } + break; + case PhabricatorTransactions::TYPE_COMMENT: + case self::TYPE_INLINE: + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_COMMENT; + break; + } + + if (!$tags) { + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_OTHER; + } + + return $tags; + } + public function getTitle() { $author_phid = $this->getAuthorPHID(); $author_handle = $this->renderHandleLink($author_phid); Index: src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php =================================================================== --- src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php +++ src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php @@ -99,6 +99,11 @@ $params['cc'] = $this->params['ccs']; } + foreach (idx($this->params, 'headers', array()) as $header) { + list($name, $value) = $header; + $params['h:'.$name] = $value; + } + $future = new HTTPSFuture( "https://api:{$key}@api.mailgun.net/v2/{$domain}/messages", $params);