Page MenuHomePhabricator

D10712.diff
No OneTemporary

D10712.diff

diff --git a/src/applications/audit/editor/PhabricatorAuditEditor.php b/src/applications/audit/editor/PhabricatorAuditEditor.php
--- a/src/applications/audit/editor/PhabricatorAuditEditor.php
+++ b/src/applications/audit/editor/PhabricatorAuditEditor.php
@@ -702,6 +702,33 @@
return implode("\n", $block);
}
+ public function getMailTagsMap() {
+ return array(
+ PhabricatorAuditTransaction::MAILTAG_COMMIT =>
+ pht('A commit is created.'),
+ PhabricatorAuditTransaction::MAILTAG_ACTION_CONCERN =>
+ pht('A commit has a concerned raised against it.'),
+ PhabricatorAuditTransaction::MAILTAG_ACTION_ACCEPT =>
+ pht('A commit is accepted.'),
+ PhabricatorAuditTransaction::MAILTAG_ACTION_RESIGN =>
+ pht('A commit has an auditor resign.'),
+ PhabricatorAuditTransaction::MAILTAG_ACTION_CLOSE =>
+ pht('A commit is closed.'),
+ PhabricatorAuditTransaction::MAILTAG_ADD_AUDITORS =>
+ pht('A commit has auditors added.'),
+ PhabricatorAuditTransaction::MAILTAG_ADD_CCS =>
+ pht("A commit's subscribers change."),
+ PhabricatorAuditTransaction::MAILTAG_PROJECTS =>
+ pht("A commit's projects change."),
+ PhabricatorAuditTransaction::MAILTAG_COMMENT =>
+ pht('Someone comments on a commit.'),
+ PhabricatorAuditTransaction::MAILTAG_OTHER =>
+ pht('Other commit activity not listed above occurs.'),
+ );
+ }
+
+
+
protected function shouldPublishFeedStory(
PhabricatorLiskDAO $object,
array $xactions) {
diff --git a/src/applications/audit/storage/PhabricatorAuditTransaction.php b/src/applications/audit/storage/PhabricatorAuditTransaction.php
--- a/src/applications/audit/storage/PhabricatorAuditTransaction.php
+++ b/src/applications/audit/storage/PhabricatorAuditTransaction.php
@@ -5,6 +5,17 @@
const TYPE_COMMIT = 'audit:commit';
+ const MAILTAG_ACTION_CONCERN = 'audit-action-concern';
+ const MAILTAG_ACTION_ACCEPT = 'audit-action-accept';
+ const MAILTAG_ACTION_RESIGN = 'audit-action-resign';
+ const MAILTAG_ACTION_CLOSE = 'audit-action-close';
+ const MAILTAG_ADD_AUDITORS = 'audit-add-auditors';
+ const MAILTAG_ADD_CCS = 'audit-add-ccs';
+ const MAILTAG_COMMENT = 'audit-comment';
+ const MAILTAG_COMMIT = 'audit-commit';
+ const MAILTAG_PROJECTS = 'audit-projects';
+ const MAILTAG_OTHER = 'audit-other';
+
public function getApplicationName() {
return 'audit';
}
@@ -403,4 +414,55 @@
return parent::getBodyForMail();
}
+ public function getMailTags() {
+ $tags = array();
+ switch ($this->getTransactionType()) {
+ case PhabricatorAuditActionConstants::ACTION:
+ switch ($this->getNewValue()) {
+ case PhabricatorAuditActionConstants::CONCERN:
+ $tags[] = self::MAILTAG_ACTION_CONCERN;
+ break;
+ case PhabricatorAuditActionConstants::ACCEPT:
+ $tags[] = self::MAILTAG_ACTION_ACCEPT;
+ break;
+ case PhabricatorAuditActionConstants::RESIGN:
+ $tags[] = self::MAILTAG_ACTION_RESIGN;
+ break;
+ case PhabricatorAuditActionConstants::CLOSE:
+ $tags[] = self::MAILTAG_ACTION_CLOSE;
+ break;
+ }
+ break;
+ case PhabricatorAuditActionConstants::ADD_AUDITORS:
+ $tags[] = self::MAILTAG_ADD_AUDITORS;
+ break;
+ case PhabricatorAuditActionConstants::ADD_CCS:
+ $tags[] = self::MAILTAG_ADD_CCS;
+ break;
+ case PhabricatorAuditActionConstants::INLINE:
+ case PhabricatorTransactions::TYPE_COMMENT:
+ $tags[] = self::MAILTAG_COMMENT;
+ break;
+ case self::TYPE_COMMIT:
+ $tags[] = self::MAILTAG_COMMIT;
+ break;
+ case PhabricatorTransactions::TYPE_EDGE:
+ switch ($this->getMetadataValue('edge:type')) {
+ case PhabricatorProjectObjectHasProjectEdgeType::EDGECONST:
+ $tags[] = self::MAILTAG_PROJECTS;
+ break;
+ case PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER:
+ $tags[] = self::MAILTAG_ADD_CCS;
+ break;
+ default:
+ $tags[] = self::MAILTAG_OTHER;
+ break;
+ }
+ break;
+ default:
+ $tags[] = self::MAILTAG_OTHER;
+ break;
+ }
+ return $tags;
+ }
}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 10, 10:17 PM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715870
Default Alt Text
D10712.diff (4 KB)

Event Timeline