@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Clean up some Differential behaviors

Summary:
Ref T2222.

- Restore mail tags for ApplicationTransactions mail.
- Restore subject line verbs.
- Denormalize line count and repository PHID.
- Fix an issue with the mailgun adapter where headers weren't attached properly.

Test Plan: Sent some mail, verified it had correct subjects and tags.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2222

Differential Revision: https://secure.phabricator.com/D8378

+72
+4
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 364 364 365 365 $diff->setRevisionID($object->getID()); 366 366 $diff->save(); 367 + 368 + $object->setLineCount($diff->getLineCount()); 369 + $object->setRepositoryPHID($diff->getRepositoryPHID()); 370 + 367 371 return; 368 372 } 369 373
+63
src/applications/differential/storage/DifferentialTransaction.php
··· 87 87 return $phids; 88 88 } 89 89 90 + public function getActionName() { 91 + switch ($this->getTransactionType()) { 92 + case self::TYPE_INLINE: 93 + return pht('Commented On'); 94 + case self::TYPE_UPDATE: 95 + return pht('Updated'); 96 + case self::TYPE_ACTION: 97 + $map = array( 98 + DifferentialAction::ACTION_ACCEPT => pht('Accepted'), 99 + DifferentialAction::ACTION_REJECT => pht('Requested Changes To'), 100 + DifferentialAction::ACTION_RETHINK => pht('Planned Changes To'), 101 + DifferentialAction::ACTION_ABANDON => pht('Abandoned'), 102 + DifferentialAction::ACTION_CLOSE => pht('Closed'), 103 + DifferentialAction::ACTION_REQUEST => pht('Requested A Review Of'), 104 + DifferentialAction::ACTION_RESIGN => pht('Resigned From'), 105 + DifferentialAction::ACTION_ADDREVIEWERS => pht('Added Reviewers'), 106 + DifferentialAction::ACTION_CLAIM => pht('Commandeered'), 107 + DifferentialAction::ACTION_REOPEN => pht('Reopened'), 108 + ); 109 + $name = idx($map, $this->getNewValue()); 110 + if ($name !== null) { 111 + return $name; 112 + } 113 + break; 114 + } 115 + 116 + return parent::getActionName(); 117 + } 118 + 119 + public function getMailTags() { 120 + $tags = array(); 121 + 122 + switch ($this->getTransactionType()) { 123 + case PhabricatorTransactions::TYPE_SUBSCRIBERS; 124 + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_CC; 125 + break; 126 + case self::TYPE_ACTION: 127 + switch ($this->getNewValue()) { 128 + case DifferentialAction::ACTION_CLOSE: 129 + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_CLOSED; 130 + break; 131 + } 132 + break; 133 + case PhabricatorTransactions::TYPE_EDGE: 134 + switch ($this->getMetadataValue('edge:type')) { 135 + case PhabricatorEdgeConfig::TYPE_DREV_HAS_REVIEWER: 136 + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEWERS; 137 + break; 138 + } 139 + break; 140 + case PhabricatorTransactions::TYPE_COMMENT: 141 + case self::TYPE_INLINE: 142 + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_COMMENT; 143 + break; 144 + } 145 + 146 + if (!$tags) { 147 + $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_OTHER; 148 + } 149 + 150 + return $tags; 151 + } 152 + 90 153 public function getTitle() { 91 154 $author_phid = $this->getAuthorPHID(); 92 155 $author_handle = $this->renderHandleLink($author_phid);
+5
src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php
··· 99 99 $params['cc'] = $this->params['ccs']; 100 100 } 101 101 102 + foreach (idx($this->params, 'headers', array()) as $header) { 103 + list($name, $value) = $header; 104 + $params['h:'.$name] = $value; 105 + } 106 + 102 107 $future = new HTTPSFuture( 103 108 "https://api:{$key}@api.mailgun.net/v2/{$domain}/messages", 104 109 $params);