1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Move commits to the "COMMIT" mail prefix

Summary:
Fixes T9427. Currently, replies to audits/commits go to "Cxxx", but so do replies to countdowns.

There is non real non-disruptive approach available here and this seems least-bad.

Test Plan:
  - Made a comment on a commit.
  - Fished the reply-to address out of `bin/mail list-oubound` + `bin/mail show-outbound` (it was now "COMMIT...").
  - Sent mail to that address.
  - Grabbed the raw message and wrote it to `mail.txt`.
  - Ran `cat mail.txt | ./scripts/mail/mail_handler.php --process-duplicates`.
  - Used `bin/mail list-inbound` + `bin/mail show-inbound` to verify receipt.
  - Saw comment appear on audit.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9427

Differential Revision: https://secure.phabricator.com/D14163
This commit is contained in:
epriestley 2015-09-25 10:43:11 -07:00
parent 8d3bb92b91
commit 36d9908e6c
2 changed files with 3 additions and 5 deletions

View file

@ -8,11 +8,11 @@ final class PhabricatorAuditMailReceiver extends PhabricatorObjectMailReceiver {
}
protected function getObjectPattern() {
return 'C[1-9]\d*';
return 'COMMIT[1-9]\d*';
}
protected function loadObject($pattern, PhabricatorUser $viewer) {
$id = (int)trim($pattern, 'C');
$id = (int)preg_replace('/^COMMIT/', '', $pattern);
return id(new DiffusionCommitQuery())
->setViewer($viewer)

View file

@ -13,9 +13,7 @@ final class PhabricatorAuditReplyHandler
}
public function getObjectPrefix() {
// TODO: This conflicts with Countdown and will probably need to be
// changed eventually.
return 'C';
return 'COMMIT';
}
}