@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

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

+3 -5
+2 -2
src/applications/audit/mail/PhabricatorAuditMailReceiver.php
··· 8 8 } 9 9 10 10 protected function getObjectPattern() { 11 - return 'C[1-9]\d*'; 11 + return 'COMMIT[1-9]\d*'; 12 12 } 13 13 14 14 protected function loadObject($pattern, PhabricatorUser $viewer) { 15 - $id = (int)trim($pattern, 'C'); 15 + $id = (int)preg_replace('/^COMMIT/', '', $pattern); 16 16 17 17 return id(new DiffusionCommitQuery()) 18 18 ->setViewer($viewer)
+1 -3
src/applications/audit/mail/PhabricatorAuditReplyHandler.php
··· 13 13 } 14 14 15 15 public function getObjectPrefix() { 16 - // TODO: This conflicts with Countdown and will probably need to be 17 - // changed eventually. 18 - return 'C'; 16 + return 'COMMIT'; 19 17 } 20 18 21 19 }