Page MenuHomePhabricator

D11564.id27837.diff
No OneTemporary

D11564.id27837.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -378,7 +378,7 @@
'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => 'e5822781',
'rsrc/js/application/files/behavior-icon-composer.js' => '8ef9ab58',
'rsrc/js/application/files/behavior-launch-icon-composer.js' => '48086888',
- 'rsrc/js/application/herald/HeraldRuleEditor.js' => '335fd41f',
+ 'rsrc/js/application/herald/HeraldRuleEditor.js' => '6e2de6f2',
'rsrc/js/application/herald/PathTypeahead.js' => 'f7fc67ec',
'rsrc/js/application/herald/herald-rule-editor.js' => '7ebaeed3',
'rsrc/js/application/maniphest/behavior-batch-editor.js' => 'f24f3253',
@@ -530,7 +530,7 @@
'global-drag-and-drop-css' => '697324ad',
'harbormaster-css' => '49d64eb4',
'herald-css' => '826075fa',
- 'herald-rule-editor' => '335fd41f',
+ 'herald-rule-editor' => '6e2de6f2',
'herald-test-css' => '778b008e',
'homepage-panel-css' => 'e34bf140',
'inline-comment-summary-css' => '8cfd34e8',
@@ -1028,15 +1028,6 @@
'javelin-behavior-device',
'phabricator-title',
),
- '335fd41f' => array(
- 'multirow-row-manager',
- 'javelin-install',
- 'javelin-util',
- 'javelin-dom',
- 'javelin-stratcom',
- 'javelin-json',
- 'phabricator-prefab',
- ),
'3ab51e2c' => array(
'javelin-behavior',
'javelin-behavior-device',
@@ -1292,6 +1283,15 @@
'javelin-typeahead',
'javelin-uri',
),
+ '6e2de6f2' => array(
+ 'multirow-row-manager',
+ 'javelin-install',
+ 'javelin-util',
+ 'javelin-dom',
+ 'javelin-stratcom',
+ 'javelin-json',
+ 'phabricator-prefab',
+ ),
'6e8cefa4' => array(
'javelin-install',
'javelin-dom',
diff --git a/src/applications/herald/adapter/HeraldAdapter.php b/src/applications/herald/adapter/HeraldAdapter.php
--- a/src/applications/herald/adapter/HeraldAdapter.php
+++ b/src/applications/herald/adapter/HeraldAdapter.php
@@ -39,6 +39,7 @@
const FIELD_AUTHOR_RAW = 'author-raw';
const FIELD_COMMITTER_RAW = 'committer-raw';
const FIELD_IS_NEW_OBJECT = 'new-object';
+ const FIELD_APPLICATION_EMAIL = 'applicaton-email';
const FIELD_TASK_PRIORITY = 'taskpriority';
const FIELD_TASK_STATUS = 'taskstatus';
const FIELD_ARCANIST_PROJECT = 'arcanist-project';
@@ -98,11 +99,13 @@
const VALUE_BUILD_PLAN = 'buildplan';
const VALUE_TASK_PRIORITY = 'taskpriority';
const VALUE_TASK_STATUS = 'taskstatus';
- const VALUE_ARCANIST_PROJECT = 'arcanistprojects';
- const VALUE_LEGAL_DOCUMENTS = 'legaldocuments';
+ const VALUE_ARCANIST_PROJECT = 'arcanistprojects';
+ const VALUE_LEGAL_DOCUMENTS = 'legaldocuments';
+ const VALUE_APPLICATION_EMAIL = 'applicationemail';
private $contentSource;
private $isNewObject;
+ private $applicationEmail;
private $customFields = false;
private $customActions = null;
private $queuedTransactions = array();
@@ -156,6 +159,16 @@
return $this;
}
+ public function setApplicationEmail(
+ PhabricatorMetaMTAApplicationEmail $email) {
+ $this->applicationEmail = $email;
+ return $this;
+ }
+
+ public function getApplicationEmail() {
+ return $this->applicationEmail;
+ }
+
abstract public function getPHID();
abstract public function getHeraldName();
@@ -169,6 +182,14 @@
return true;
case self::FIELD_IS_NEW_OBJECT:
return $this->getIsNewObject();
+ case self::FIELD_APPLICATION_EMAIL:
+ $value = array();
+ // while there is only one match by implementation, we do set
+ // comparisons on phids, so return an array with just the phid
+ if ($this->getApplicationEmail()) {
+ $value[] = $this->getApplicationEmail()->getPHID();
+ }
+ return $value;
default:
if ($this->isHeraldCustomKey($field_name)) {
return $this->getCustomFieldValue($field_name);
@@ -312,6 +333,7 @@
self::FIELD_AUTHOR_RAW => pht('Raw author name'),
self::FIELD_COMMITTER_RAW => pht('Raw committer name'),
self::FIELD_IS_NEW_OBJECT => pht('Is newly created?'),
+ self::FIELD_APPLICATION_EMAIL => pht('Receiving email address'),
self::FIELD_TASK_PRIORITY => pht('Task priority'),
self::FIELD_TASK_STATUS => pht('Task status'),
self::FIELD_ARCANIST_PROJECT => pht('Arcanist Project'),
@@ -401,6 +423,13 @@
self::CONDITION_EXISTS,
self::CONDITION_NOT_EXISTS,
);
+ case self::FIELD_APPLICATION_EMAIL:
+ return array(
+ self::CONDITION_INCLUDE_ANY,
+ self::CONDITION_INCLUDE_NONE,
+ self::CONDITION_EXISTS,
+ self::CONDITION_NOT_EXISTS,
+ );
case self::FIELD_DIFF_FILE:
case self::FIELD_BRANCHES:
return array(
@@ -874,6 +903,8 @@
return self::VALUE_PROJECT;
case self::FIELD_REVIEWERS:
return self::VALUE_USER_OR_PROJECT;
+ case self::FIELD_APPLICATION_EMAIL:
+ return self::VALUE_APPLICATION_EMAIL;
default:
return self::VALUE_USER;
}
diff --git a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
--- a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
+++ b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
@@ -91,6 +91,7 @@
self::FIELD_TASK_PRIORITY,
self::FIELD_TASK_STATUS,
self::FIELD_IS_NEW_OBJECT,
+ self::FIELD_APPLICATION_EMAIL,
),
parent::getFields());
}
diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php
--- a/src/applications/herald/controller/HeraldRuleController.php
+++ b/src/applications/herald/controller/HeraldRuleController.php
@@ -602,6 +602,7 @@
'user' => new PhabricatorPeopleDatasource(),
'email' => new PhabricatorMetaMTAMailableDatasource(),
'userorproject' => new PhabricatorProjectOrUserDatasource(),
+ 'applicationemail' => new PhabricatorMetaMTAApplicationEmailDatasource(),
);
foreach ($sources as $key => $source) {
diff --git a/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php b/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php
--- a/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php
+++ b/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php
@@ -41,6 +41,7 @@
$handler->setActor($sender);
$handler->setExcludeMailRecipientPHIDs(
$mail->loadExcludeMailRecipientPHIDs());
+ $handler->setApplicationEmail($this->getApplicationEmail());
$handler->processEmail($mail);
$mail->setRelatedPHID($task->getPHID());
diff --git a/src/applications/maniphest/mail/ManiphestReplyHandler.php b/src/applications/maniphest/mail/ManiphestReplyHandler.php
--- a/src/applications/maniphest/mail/ManiphestReplyHandler.php
+++ b/src/applications/maniphest/mail/ManiphestReplyHandler.php
@@ -171,6 +171,7 @@
->setContinueOnNoEffect(true)
->setContinueOnMissingFields(true)
->setContentSource($content_source)
+ ->setApplicationEmail($this->getApplicationEmail())
->applyTransactions($task, $xactions);
$event = new PhabricatorEvent(
diff --git a/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php b/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php
--- a/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php
+++ b/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php
@@ -3,6 +3,7 @@
abstract class PhabricatorMailReplyHandler {
private $mailReceiver;
+ private $applicationEmail;
private $actor;
private $excludePHIDs = array();
@@ -16,6 +17,16 @@
return $this->mailReceiver;
}
+ public function setApplicationEmail(
+ PhabricatorMetaMTAApplicationEmail $email) {
+ $this->applicationEmail = $email;
+ return $this;
+ }
+
+ public function getApplicationEmail() {
+ return $this->applicationEmail;
+ }
+
final public function setActor(PhabricatorUser $actor) {
$this->actor = $actor;
return $this;
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -22,6 +22,7 @@
private $heraldTranscript;
private $subscribers;
private $unmentionablePHIDMap = array();
+ private $applicationEmail;
private $isPreview;
private $isHeraldEditor;
@@ -185,6 +186,16 @@
return $this->unmentionablePHIDMap;
}
+ public function setApplicationEmail(
+ PhabricatorMetaMTAApplicationEmail $email) {
+ $this->applicationEmail = $email;
+ return $this;
+ }
+
+ public function getApplicationEmail() {
+ return $this->applicationEmail;
+ }
+
public function getTransactionTypes() {
$types = array();
@@ -2427,6 +2438,7 @@
$adapter = $this->buildHeraldAdapter($object, $xactions);
$adapter->setContentSource($this->getContentSource());
$adapter->setIsNewObject($this->getIsNewObject());
+ $adapter->setApplicationEmail($this->getApplicationEmail());
$xscript = HeraldEngine::loadAndApplyRules($adapter);
$this->setHeraldAdapter($adapter);
diff --git a/webroot/rsrc/js/application/herald/HeraldRuleEditor.js b/webroot/rsrc/js/application/herald/HeraldRuleEditor.js
--- a/webroot/rsrc/js/application/herald/HeraldRuleEditor.js
+++ b/webroot/rsrc/js/application/herald/HeraldRuleEditor.js
@@ -222,6 +222,7 @@
case 'taskstatus':
case 'arcanistprojects':
case 'legaldocuments':
+ case 'applicationemail':
var tokenizer = this._newTokenizer(type);
input = tokenizer[0];
get_fn = tokenizer[1];

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 12:10 PM (6 h, 18 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6794089
Default Alt Text
D11564.id27837.diff (9 KB)

Event Timeline