@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 Differential draft mail behaviors

Summary:
Ref T2543. Fixes two relatively minor things:

- When builds finish in Harbormaster, send mail "From" the author.
- Set the `firstBroadcast` flag so that initial mail picks up earlier history (notably, the "reviewers" line).

For now, I'm not setting `firstBroadcast` on explicit "Request Review" (but maybe we should), and not trying to deal with weird cases where you leave a bunch of comments on a draft. Those might be fine as-is or may get tweaked later.

Test Plan: Created a revision with Harbormaster builds, ran builds, saw initial email come "From" the right user with more metadata.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T2543

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

+17 -1
+17 -1
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 9 9 private $didExpandInlineState = false; 10 10 private $hasReviewTransaction = false; 11 11 private $affectedPaths; 12 + private $firstBroadcast = false; 12 13 13 14 public function getEditorApplicationClass() { 14 15 return 'PhabricatorDifferentialApplication'; ··· 27 28 } 28 29 29 30 public function isFirstBroadcast() { 30 - return $this->getIsNewObject(); 31 + return $this->firstBroadcast; 31 32 } 32 33 33 34 public function getDiffUpdateTransaction(array $xactions) { ··· 1449 1450 protected function getCustomWorkerState() { 1450 1451 return array( 1451 1452 'changedPriorToCommitURI' => $this->changedPriorToCommitURI, 1453 + 'firstBroadcast' => $this->firstBroadcast, 1452 1454 ); 1453 1455 } 1454 1456 1455 1457 protected function loadCustomWorkerState(array $state) { 1456 1458 $this->changedPriorToCommitURI = idx($state, 'changedPriorToCommitURI'); 1459 + $this->firstBroadcast = idx($state, 'firstBroadcast'); 1457 1460 return $this; 1458 1461 } 1459 1462 ··· 1565 1568 // attribute the action to the revision author since this is more 1566 1569 // natural and more useful. 1567 1570 $author_phid = $object->getAuthorPHID(); 1571 + 1572 + // Additionally, we change the acting PHID for the transaction set 1573 + // to the author if it isn't already a user so that mail comes from 1574 + // the natural author. 1575 + $acting_phid = $this->getActingAsPHID(); 1576 + $user_type = PhabricatorPeopleUserPHIDType::TYPECONST; 1577 + if (phid_get_type($acting_phid) != $user_type) { 1578 + $this->setActingAsPHID($author_phid); 1579 + } 1580 + 1581 + // Mark this as the first broadcast we're sending about the revision 1582 + // so mail can generate specially. 1583 + $this->firstBroadcast = true; 1568 1584 1569 1585 $xaction = $object->getApplicationTransactionTemplate() 1570 1586 ->setAuthorPHID($author_phid)