@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.

Send audit emails to more users

Summary:
Audit has some weird rules about who gets email. Make them less weird:

- When a user does "Add Auditors", email the auditors.
- When a commit is commented on, email anyone in "concern" or "audit required" states.

@staticshock, my claim that I can't reproduce was crazy, I just have weird test data and read it wrong.

Test Plan: Added a user to an audit and verified they got an email.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: staticshock, aran

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

+16 -7
+16 -7
src/applications/audit/editor/PhabricatorAuditCommentEditor.php
··· 407 407 $threading = self::getMailThreading($repository, $commit); 408 408 list($thread_id, $thread_topic) = $threading; 409 409 410 - $body = $this->renderMailBody( 410 + $body = $this->renderMailBody( 411 411 $comment, 412 412 "{$name}: {$summary}", 413 413 $handle, ··· 419 419 420 420 $author_phid = $data->getCommitDetail('authorPHID'); 421 421 if ($author_phid) { 422 - $email_to[] = $author_phid; 422 + $email_to[$author_phid] = true; 423 423 } 424 424 425 425 foreach ($other_comments as $other_comment) { ··· 427 427 } 428 428 429 429 foreach ($requests as $request) { 430 - if ($request->getAuditStatus() == PhabricatorAuditStatusConstants::CC) { 431 - $email_cc[$request->getAuditorPHID()] = true; 432 - } else if ($request->getAuditStatus() == 433 - PhabricatorAuditStatusConstants::RESIGNED) { 434 - unset($email_cc[$request->getAuditorPHID()]); 430 + switch ($request->getAuditStatus()) { 431 + case PhabricatorAuditStatusConstants::CC: 432 + case PhabricatorAuditStatusConstants::AUDIT_REQUIRED: 433 + $email_cc[$request->getAuditorPHID()] = true; 434 + break; 435 + case PhabricatorAuditStatusConstants::RESIGNED: 436 + unset($email_cc[$request->getAuditorPHID()]); 437 + break; 438 + case PhabricatorAuditStatusConstants::CONCERNED: 439 + case PhabricatorAuditStatusConstants::AUDIT_REQUESTED: 440 + $email_to[$request->getAuditorPHID()] = true; 441 + break; 435 442 } 436 443 } 444 + 445 + $email_to = array_keys($email_to); 437 446 $email_cc = array_keys($email_cc); 438 447 439 448 $phids = array_merge($email_to, $email_cc);