mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-25 06:50:55 +01:00
Expose all application mail receivers
Summary: Fixes T7199. This still isn't a shining example of perfect code, but the raw amount of copy/paste is much lower than it used to be. - Reduce code duplication between existing receivers. - Expose receiving objects in help menus where appropriate. - Connect some "TODO" receivers. Test Plan: - Sent mail to every supported object type. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7199 Differential Revision: https://secure.phabricator.com/D12249
This commit is contained in:
parent
52eab87608
commit
eb81fd1562
25 changed files with 177 additions and 135 deletions
|
@ -391,7 +391,6 @@ phutil_register_library_map(array(
|
||||||
'DifferentialLintField' => 'applications/differential/customfield/DifferentialLintField.php',
|
'DifferentialLintField' => 'applications/differential/customfield/DifferentialLintField.php',
|
||||||
'DifferentialLintStatus' => 'applications/differential/constants/DifferentialLintStatus.php',
|
'DifferentialLintStatus' => 'applications/differential/constants/DifferentialLintStatus.php',
|
||||||
'DifferentialLocalCommitsView' => 'applications/differential/view/DifferentialLocalCommitsView.php',
|
'DifferentialLocalCommitsView' => 'applications/differential/view/DifferentialLocalCommitsView.php',
|
||||||
'DifferentialMail' => 'applications/differential/mail/DifferentialMail.php',
|
|
||||||
'DifferentialManiphestTasksField' => 'applications/differential/customfield/DifferentialManiphestTasksField.php',
|
'DifferentialManiphestTasksField' => 'applications/differential/customfield/DifferentialManiphestTasksField.php',
|
||||||
'DifferentialModernHunk' => 'applications/differential/storage/DifferentialModernHunk.php',
|
'DifferentialModernHunk' => 'applications/differential/storage/DifferentialModernHunk.php',
|
||||||
'DifferentialParseCacheGarbageCollector' => 'applications/differential/garbagecollector/DifferentialParseCacheGarbageCollector.php',
|
'DifferentialParseCacheGarbageCollector' => 'applications/differential/garbagecollector/DifferentialParseCacheGarbageCollector.php',
|
||||||
|
@ -976,7 +975,7 @@ phutil_register_library_map(array(
|
||||||
'LegalpadDocumentSignatureSearchEngine' => 'applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php',
|
'LegalpadDocumentSignatureSearchEngine' => 'applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php',
|
||||||
'LegalpadDocumentSignatureVerificationController' => 'applications/legalpad/controller/LegalpadDocumentSignatureVerificationController.php',
|
'LegalpadDocumentSignatureVerificationController' => 'applications/legalpad/controller/LegalpadDocumentSignatureVerificationController.php',
|
||||||
'LegalpadDocumentSignatureViewController' => 'applications/legalpad/controller/LegalpadDocumentSignatureViewController.php',
|
'LegalpadDocumentSignatureViewController' => 'applications/legalpad/controller/LegalpadDocumentSignatureViewController.php',
|
||||||
'LegalpadMockMailReceiver' => 'applications/legalpad/mail/LegalpadMockMailReceiver.php',
|
'LegalpadMailReceiver' => 'applications/legalpad/mail/LegalpadMailReceiver.php',
|
||||||
'LegalpadObjectNeedsSignatureEdgeType' => 'applications/legalpad/edge/LegalpadObjectNeedsSignatureEdgeType.php',
|
'LegalpadObjectNeedsSignatureEdgeType' => 'applications/legalpad/edge/LegalpadObjectNeedsSignatureEdgeType.php',
|
||||||
'LegalpadReplyHandler' => 'applications/legalpad/mail/LegalpadReplyHandler.php',
|
'LegalpadReplyHandler' => 'applications/legalpad/mail/LegalpadReplyHandler.php',
|
||||||
'LegalpadSchemaSpec' => 'applications/legalpad/storage/LegalpadSchemaSpec.php',
|
'LegalpadSchemaSpec' => 'applications/legalpad/storage/LegalpadSchemaSpec.php',
|
||||||
|
@ -3442,6 +3441,7 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceThread' => array(
|
'ConpherenceThread' => array(
|
||||||
'ConpherenceDAO',
|
'ConpherenceDAO',
|
||||||
'PhabricatorPolicyInterface',
|
'PhabricatorPolicyInterface',
|
||||||
|
'PhabricatorApplicationTransactionInterface',
|
||||||
),
|
),
|
||||||
'ConpherenceThreadIndexer' => 'PhabricatorSearchDocumentIndexer',
|
'ConpherenceThreadIndexer' => 'PhabricatorSearchDocumentIndexer',
|
||||||
'ConpherenceThreadListView' => 'AphrontView',
|
'ConpherenceThreadListView' => 'AphrontView',
|
||||||
|
@ -3577,7 +3577,6 @@ phutil_register_library_map(array(
|
||||||
'DifferentialLegacyHunk' => 'DifferentialHunk',
|
'DifferentialLegacyHunk' => 'DifferentialHunk',
|
||||||
'DifferentialLintField' => 'DifferentialCustomField',
|
'DifferentialLintField' => 'DifferentialCustomField',
|
||||||
'DifferentialLocalCommitsView' => 'AphrontView',
|
'DifferentialLocalCommitsView' => 'AphrontView',
|
||||||
'DifferentialMail' => 'PhabricatorMail',
|
|
||||||
'DifferentialManiphestTasksField' => 'DifferentialCoreCustomField',
|
'DifferentialManiphestTasksField' => 'DifferentialCoreCustomField',
|
||||||
'DifferentialModernHunk' => 'DifferentialHunk',
|
'DifferentialModernHunk' => 'DifferentialHunk',
|
||||||
'DifferentialParseCacheGarbageCollector' => 'PhabricatorGarbageCollector',
|
'DifferentialParseCacheGarbageCollector' => 'PhabricatorGarbageCollector',
|
||||||
|
@ -4229,7 +4228,7 @@ phutil_register_library_map(array(
|
||||||
'LegalpadDocumentSignatureSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
'LegalpadDocumentSignatureSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||||
'LegalpadDocumentSignatureVerificationController' => 'LegalpadController',
|
'LegalpadDocumentSignatureVerificationController' => 'LegalpadController',
|
||||||
'LegalpadDocumentSignatureViewController' => 'LegalpadController',
|
'LegalpadDocumentSignatureViewController' => 'LegalpadController',
|
||||||
'LegalpadMockMailReceiver' => 'PhabricatorObjectMailReceiver',
|
'LegalpadMailReceiver' => 'PhabricatorObjectMailReceiver',
|
||||||
'LegalpadObjectNeedsSignatureEdgeType' => 'PhabricatorEdgeType',
|
'LegalpadObjectNeedsSignatureEdgeType' => 'PhabricatorEdgeType',
|
||||||
'LegalpadReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
|
'LegalpadReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
|
||||||
'LegalpadSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
'LegalpadSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||||
|
|
|
@ -38,12 +38,6 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor {
|
||||||
return array_keys($phids);
|
return array_keys($phids);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function newReplyHandlerForCommit($commit) {
|
|
||||||
$reply_handler = new PhabricatorAuditReplyHandler();
|
|
||||||
$reply_handler->setMailReceiver($commit);
|
|
||||||
return $reply_handler;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getMailThreading(
|
public static function getMailThreading(
|
||||||
PhabricatorRepository $repository,
|
PhabricatorRepository $repository,
|
||||||
PhabricatorRepositoryCommit $commit) {
|
PhabricatorRepositoryCommit $commit) {
|
||||||
|
|
|
@ -21,17 +21,8 @@ final class PhabricatorAuditMailReceiver extends PhabricatorObjectMailReceiver {
|
||||||
->executeOne();
|
->executeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processReceivedObjectMail(
|
protected function getTransactionReplyHandler() {
|
||||||
PhabricatorMetaMTAReceivedMail $mail,
|
return new PhabricatorAuditReplyHandler();
|
||||||
PhabricatorLiskDAO $object,
|
|
||||||
PhabricatorUser $sender) {
|
|
||||||
|
|
||||||
$handler = PhabricatorAuditCommentEditor::newReplyHandlerForCommit($object);
|
|
||||||
|
|
||||||
$handler->setActor($sender);
|
|
||||||
$handler->setExcludeMailRecipientPHIDs(
|
|
||||||
$mail->loadExcludeMailRecipientPHIDs());
|
|
||||||
$handler->processEmail($mail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,4 +65,14 @@ final class PhabricatorConpherenceApplication extends PhabricatorApplication {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMailCommandObjects() {
|
||||||
|
|
||||||
|
// TODO: Conpherence threads don't currently support any commands directly,
|
||||||
|
// so the documentation page we end up generating is empty and funny
|
||||||
|
// looking. Add support here once we support "!add", "!leave", "!topic",
|
||||||
|
// or whatever else.
|
||||||
|
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,18 +23,8 @@ final class ConpherenceThreadMailReceiver
|
||||||
->executeOne();
|
->executeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processReceivedObjectMail(
|
protected function getTransactionReplyHandler() {
|
||||||
PhabricatorMetaMTAReceivedMail $mail,
|
return new ConpherenceReplyHandler();
|
||||||
PhabricatorLiskDAO $object,
|
|
||||||
PhabricatorUser $sender) {
|
|
||||||
|
|
||||||
$handler = id(new ConpherenceReplyHandler())
|
|
||||||
->setMailReceiver($object);
|
|
||||||
|
|
||||||
$handler->setActor($sender);
|
|
||||||
$handler->setExcludeMailRecipientPHIDs(
|
|
||||||
$mail->loadExcludeMailRecipientPHIDs());
|
|
||||||
$handler->processEmail($mail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class ConpherenceThread extends ConpherenceDAO
|
final class ConpherenceThread extends ConpherenceDAO
|
||||||
implements PhabricatorPolicyInterface {
|
implements
|
||||||
|
PhabricatorPolicyInterface,
|
||||||
|
PhabricatorApplicationTransactionInterface {
|
||||||
|
|
||||||
protected $title;
|
protected $title;
|
||||||
protected $isRoom = 0;
|
protected $isRoom = 0;
|
||||||
|
@ -290,4 +292,26 @@ final class ConpherenceThread extends ConpherenceDAO
|
||||||
return $icon;
|
return $icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -( PhabricatorApplicationTransactionInterface )------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
public function getApplicationTransactionEditor() {
|
||||||
|
return new ConpherenceEditor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getApplicationTransactionObject() {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getApplicationTransactionTemplate() {
|
||||||
|
return new ConpherenceTransaction();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function willRenderTimeline(
|
||||||
|
PhabricatorApplicationTransactionView $timeline,
|
||||||
|
AphrontRequest $request) {
|
||||||
|
return $timeline;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
abstract class DifferentialMail extends PhabricatorMail {
|
|
||||||
|
|
||||||
public static function newReplyHandlerForRevision(
|
|
||||||
DifferentialRevision $revision) {
|
|
||||||
$reply_handler = new DifferentialReplyHandler();
|
|
||||||
$reply_handler->setMailReceiver($revision);
|
|
||||||
return $reply_handler;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -24,17 +24,8 @@ final class DifferentialRevisionMailReceiver
|
||||||
->executeOne();
|
->executeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processReceivedObjectMail(
|
protected function getTransactionReplyHandler() {
|
||||||
PhabricatorMetaMTAReceivedMail $mail,
|
return new DifferentialReplyHandler();
|
||||||
PhabricatorLiskDAO $object,
|
|
||||||
PhabricatorUser $sender) {
|
|
||||||
|
|
||||||
$handler = DifferentialMail::newReplyHandlerForRevision($object);
|
|
||||||
|
|
||||||
$handler->setActor($sender);
|
|
||||||
$handler->setExcludeMailRecipientPHIDs(
|
|
||||||
$mail->loadExcludeMailRecipientPHIDs());
|
|
||||||
$handler->processEmail($mail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,4 +148,17 @@ final class PhabricatorDiffusionApplication extends PhabricatorApplication {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMailCommandObjects() {
|
||||||
|
return array(
|
||||||
|
'commit' => array(
|
||||||
|
'name' => pht('Email Commands: Commits'),
|
||||||
|
'header' => pht('Interacting with Commits'),
|
||||||
|
'object' => new PhabricatorRepositoryCommit(),
|
||||||
|
'summary' => pht(
|
||||||
|
'This page documents the commands you can use to interact with '.
|
||||||
|
'commits and audits in Diffusion.'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,4 +96,17 @@ final class PhabricatorFilesApplication extends PhabricatorApplication {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMailCommandObjects() {
|
||||||
|
return array(
|
||||||
|
'file' => array(
|
||||||
|
'name' => pht('Email Commands: Files'),
|
||||||
|
'header' => pht('Interacting with Files'),
|
||||||
|
'object' => new PhabricatorFile(),
|
||||||
|
'summary' => pht(
|
||||||
|
'This page documents the commands you can use to interact with '.
|
||||||
|
'files.'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,18 +20,8 @@ final class FileMailReceiver extends PhabricatorObjectMailReceiver {
|
||||||
->executeOne();
|
->executeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processReceivedObjectMail(
|
protected function getTransactionReplyHandler() {
|
||||||
PhabricatorMetaMTAReceivedMail $mail,
|
return new FileReplyHandler();
|
||||||
PhabricatorLiskDAO $object,
|
|
||||||
PhabricatorUser $sender) {
|
|
||||||
|
|
||||||
$handler = id(new FileReplyHandler())
|
|
||||||
->setMailReceiver($object);
|
|
||||||
|
|
||||||
$handler->setActor($sender);
|
|
||||||
$handler->setExcludeMailRecipientPHIDs(
|
|
||||||
$mail->loadExcludeMailRecipientPHIDs());
|
|
||||||
$handler->processEmail($mail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,4 +80,17 @@ final class PhabricatorLegalpadApplication extends PhabricatorApplication {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMailCommandObjects() {
|
||||||
|
return array(
|
||||||
|
'document' => array(
|
||||||
|
'name' => pht('Email Commands: Legalpad Documents'),
|
||||||
|
'header' => pht('Interacting with Legalpad Documents'),
|
||||||
|
'object' => new LegalpadDocument(),
|
||||||
|
'summary' => pht(
|
||||||
|
'This page documents the commands you can use to interact with '.
|
||||||
|
'documents in Legalpad.'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class LegalpadMockMailReceiver extends PhabricatorObjectMailReceiver {
|
final class LegalpadMailReceiver extends PhabricatorObjectMailReceiver {
|
||||||
|
|
||||||
public function isEnabled() {
|
public function isEnabled() {
|
||||||
$app_class = 'PhabricatorLegalpadApplication';
|
$app_class = 'PhabricatorLegalpadApplication';
|
||||||
|
@ -21,18 +21,8 @@ final class LegalpadMockMailReceiver extends PhabricatorObjectMailReceiver {
|
||||||
->executeOne();
|
->executeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processReceivedObjectMail(
|
protected function getTransactionReplyHandler() {
|
||||||
PhabricatorMetaMTAReceivedMail $mail,
|
return new LegalpadReplyHandler();
|
||||||
PhabricatorLiskDAO $object,
|
|
||||||
PhabricatorUser $sender) {
|
|
||||||
|
|
||||||
$handler = id(new LegalpadReplyHandler())
|
|
||||||
->setMailReceiver($object)
|
|
||||||
->setActor($sender)
|
|
||||||
->setExcludeMailRecipientPHIDs(
|
|
||||||
$mail->loadExcludeMailRecipientPHIDs());
|
|
||||||
|
|
||||||
return $handler->processEmail($mail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -57,4 +57,17 @@ final class PhabricatorMacroApplication extends PhabricatorApplication {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMailCommandObjects() {
|
||||||
|
return array(
|
||||||
|
'macro' => array(
|
||||||
|
'name' => pht('Email Commands: Macros'),
|
||||||
|
'header' => pht('Interacting with Macros'),
|
||||||
|
'object' => new PhabricatorFileImageMacro(),
|
||||||
|
'summary' => pht(
|
||||||
|
'This page documents the commands you can use to interact with '.
|
||||||
|
'image macros.'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,13 +20,8 @@ final class PhabricatorMacroMailReceiver extends PhabricatorObjectMailReceiver {
|
||||||
->executeOne();
|
->executeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processReceivedObjectMail(
|
protected function getTransactionReplyHandler() {
|
||||||
PhabricatorMetaMTAReceivedMail $mail,
|
return new PhabricatorMacroReplyHandler();
|
||||||
PhabricatorLiskDAO $object,
|
|
||||||
PhabricatorUser $sender) {
|
|
||||||
|
|
||||||
// TODO: For now, we just drop this mail on the floor.
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,18 +24,8 @@ final class ManiphestTaskMailReceiver extends PhabricatorObjectMailReceiver {
|
||||||
return head($results);
|
return head($results);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processReceivedObjectMail(
|
protected function getTransactionReplyHandler() {
|
||||||
PhabricatorMetaMTAReceivedMail $mail,
|
return new ManiphestReplyHandler();
|
||||||
PhabricatorLiskDAO $object,
|
|
||||||
PhabricatorUser $sender) {
|
|
||||||
|
|
||||||
$handler = new ManiphestReplyHandler();
|
|
||||||
$handler->setMailReceiver($object);
|
|
||||||
|
|
||||||
$handler->setActor($sender);
|
|
||||||
$handler->setExcludeMailRecipientPHIDs(
|
|
||||||
$mail->loadExcludeMailRecipientPHIDs());
|
|
||||||
$handler->processEmail($mail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,10 +39,26 @@ abstract class PhabricatorObjectMailReceiver extends PhabricatorMailReceiver {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract protected function processReceivedObjectMail(
|
protected function processReceivedObjectMail(
|
||||||
PhabricatorMetaMTAReceivedMail $mail,
|
PhabricatorMetaMTAReceivedMail $mail,
|
||||||
PhabricatorLiskDAO $object,
|
PhabricatorLiskDAO $object,
|
||||||
PhabricatorUser $sender);
|
PhabricatorUser $sender) {
|
||||||
|
|
||||||
|
$handler = $this->getTransactionReplyHandler();
|
||||||
|
if ($handler) {
|
||||||
|
return $handler
|
||||||
|
->setMailReceiver($object)
|
||||||
|
->setActor($sender)
|
||||||
|
->setExcludeMailRecipientPHIDs($mail->loadExcludeMailRecipientPHIDs())
|
||||||
|
->processEmail($mail);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new PhutilMethodNotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getTransactionReplyHandler() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public function loadMailReceiverObject($pattern, PhabricatorUser $viewer) {
|
public function loadMailReceiverObject($pattern, PhabricatorUser $viewer) {
|
||||||
return $this->loadObject($pattern, $viewer);
|
return $this->loadObject($pattern, $viewer);
|
||||||
|
|
|
@ -82,4 +82,17 @@ final class PhabricatorPasteApplication extends PhabricatorApplication {
|
||||||
return $items;
|
return $items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMailCommandObjects() {
|
||||||
|
return array(
|
||||||
|
'paste' => array(
|
||||||
|
'name' => pht('Email Commands: Pastes'),
|
||||||
|
'header' => pht('Interacting with Pastes'),
|
||||||
|
'object' => new PhabricatorPaste(),
|
||||||
|
'summary' => pht(
|
||||||
|
'This page documents the commands you can use to interact with '.
|
||||||
|
'pastes.'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,18 +20,8 @@ final class PasteMailReceiver extends PhabricatorObjectMailReceiver {
|
||||||
->executeOne();
|
->executeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processReceivedObjectMail(
|
protected function getTransactionReplyHandler() {
|
||||||
PhabricatorMetaMTAReceivedMail $mail,
|
return new PasteReplyHandler();
|
||||||
PhabricatorLiskDAO $object,
|
|
||||||
PhabricatorUser $sender) {
|
|
||||||
|
|
||||||
$handler = id(new PasteReplyHandler())
|
|
||||||
->setMailReceiver($object);
|
|
||||||
|
|
||||||
$handler->setActor($sender);
|
|
||||||
$handler->setExcludeMailRecipientPHIDs(
|
|
||||||
$mail->loadExcludeMailRecipientPHIDs());
|
|
||||||
$handler->processEmail($mail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,4 +77,17 @@ final class PhabricatorPholioApplication extends PhabricatorApplication {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMailCommandObjects() {
|
||||||
|
return array(
|
||||||
|
'mock' => array(
|
||||||
|
'name' => pht('Email Commands: Mocks'),
|
||||||
|
'header' => pht('Interacting with Pholio Mocks'),
|
||||||
|
'object' => new PholioMock(),
|
||||||
|
'summary' => pht(
|
||||||
|
'This page documents the commands you can use to interact with '.
|
||||||
|
'mocks in Pholio.'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,12 +20,8 @@ final class PholioMockMailReceiver extends PhabricatorObjectMailReceiver {
|
||||||
->executeOne();
|
->executeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processReceivedObjectMail(
|
protected function getTransactionReplyHandler() {
|
||||||
PhabricatorMetaMTAReceivedMail $mail,
|
return new PholioReplyHandler();
|
||||||
PhabricatorLiskDAO $object,
|
|
||||||
PhabricatorUser $sender) {
|
|
||||||
|
|
||||||
// TODO: For now, we just drop this mail on the floor.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,4 +66,17 @@ final class PhabricatorPonderApplication extends PhabricatorApplication {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMailCommandObjects() {
|
||||||
|
return array(
|
||||||
|
'question' => array(
|
||||||
|
'name' => pht('Email Commands: Questions'),
|
||||||
|
'header' => pht('Interacting with Ponder Questions'),
|
||||||
|
'object' => new PonderQuestion(),
|
||||||
|
'summary' => pht(
|
||||||
|
'This page documents the commands you can use to interact with '.
|
||||||
|
'questions in Ponder.'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,13 +20,8 @@ final class PonderQuestionMailReceiver extends PhabricatorObjectMailReceiver {
|
||||||
->executeOne();
|
->executeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processReceivedObjectMail(
|
protected function getTransactionReplyHandler() {
|
||||||
PhabricatorMetaMTAReceivedMail $mail,
|
return new PonderQuestionReplyHandler();
|
||||||
PhabricatorLiskDAO $object,
|
|
||||||
PhabricatorUser $sender) {
|
|
||||||
|
|
||||||
// TODO: For now, we just drop this mail on the floor.
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,4 +78,11 @@ final class PhabricatorReleephApplication extends PhabricatorApplication {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMailCommandObjects() {
|
||||||
|
// TODO: Pull requests don't implement any interfaces which give them
|
||||||
|
// meaningful commands, so don't expose ReleephRequest here for now.
|
||||||
|
// Once we add relevant commands, return it here.
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,13 +20,8 @@ final class ReleephRequestMailReceiver extends PhabricatorObjectMailReceiver {
|
||||||
->executeOne();
|
->executeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processReceivedObjectMail(
|
protected function getTransactionReplyHandler() {
|
||||||
PhabricatorMetaMTAReceivedMail $mail,
|
return new ReleephRequestReplyHandler();
|
||||||
PhabricatorLiskDAO $object,
|
|
||||||
PhabricatorUser $sender) {
|
|
||||||
|
|
||||||
// TODO: For now, we just drop this mail on the floor.
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue