Page MenuHomePhabricator

D18748.diff
No OneTemporary

D18748.diff

diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php
--- a/src/applications/differential/editor/DifferentialTransactionEditor.php
+++ b/src/applications/differential/editor/DifferentialTransactionEditor.php
@@ -9,6 +9,7 @@
private $didExpandInlineState = false;
private $hasReviewTransaction = false;
private $affectedPaths;
+ private $firstBroadcast = false;
public function getEditorApplicationClass() {
return 'PhabricatorDifferentialApplication';
@@ -27,7 +28,7 @@
}
public function isFirstBroadcast() {
- return $this->getIsNewObject();
+ return $this->firstBroadcast;
}
public function getDiffUpdateTransaction(array $xactions) {
@@ -1449,11 +1450,13 @@
protected function getCustomWorkerState() {
return array(
'changedPriorToCommitURI' => $this->changedPriorToCommitURI,
+ 'firstBroadcast' => $this->firstBroadcast,
);
}
protected function loadCustomWorkerState(array $state) {
$this->changedPriorToCommitURI = idx($state, 'changedPriorToCommitURI');
+ $this->firstBroadcast = idx($state, 'firstBroadcast');
return $this;
}
@@ -1566,6 +1569,19 @@
// natural and more useful.
$author_phid = $object->getAuthorPHID();
+ // Additionally, we change the acting PHID for the transaction set
+ // to the author if it isn't already a user so that mail comes from
+ // the natural author.
+ $acting_phid = $this->getActingAsPHID();
+ $user_type = PhabricatorPeopleUserPHIDType::TYPECONST;
+ if (phid_get_type($acting_phid) != $user_type) {
+ $this->setActingAsPHID($author_phid);
+ }
+
+ // Mark this as the first broadcast we're sending about the revision
+ // so mail can generate specially.
+ $this->firstBroadcast = true;
+
$xaction = $object->getApplicationTransactionTemplate()
->setAuthorPHID($author_phid)
->setTransactionType(

File Metadata

Mime Type
text/plain
Expires
Thu, May 16, 1:34 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6289806
Default Alt Text
D18748.diff (2 KB)

Event Timeline