Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13960493
D12249.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
21 KB
Referenced Files
None
Subscribers
None
D12249.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -391,7 +391,6 @@
'DifferentialLintField' => 'applications/differential/customfield/DifferentialLintField.php',
'DifferentialLintStatus' => 'applications/differential/constants/DifferentialLintStatus.php',
'DifferentialLocalCommitsView' => 'applications/differential/view/DifferentialLocalCommitsView.php',
- 'DifferentialMail' => 'applications/differential/mail/DifferentialMail.php',
'DifferentialManiphestTasksField' => 'applications/differential/customfield/DifferentialManiphestTasksField.php',
'DifferentialModernHunk' => 'applications/differential/storage/DifferentialModernHunk.php',
'DifferentialParseCacheGarbageCollector' => 'applications/differential/garbagecollector/DifferentialParseCacheGarbageCollector.php',
@@ -976,7 +975,7 @@
'LegalpadDocumentSignatureSearchEngine' => 'applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php',
'LegalpadDocumentSignatureVerificationController' => 'applications/legalpad/controller/LegalpadDocumentSignatureVerificationController.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',
'LegalpadReplyHandler' => 'applications/legalpad/mail/LegalpadReplyHandler.php',
'LegalpadSchemaSpec' => 'applications/legalpad/storage/LegalpadSchemaSpec.php',
@@ -3442,6 +3441,7 @@
'ConpherenceThread' => array(
'ConpherenceDAO',
'PhabricatorPolicyInterface',
+ 'PhabricatorApplicationTransactionInterface',
),
'ConpherenceThreadIndexer' => 'PhabricatorSearchDocumentIndexer',
'ConpherenceThreadListView' => 'AphrontView',
@@ -3577,7 +3577,6 @@
'DifferentialLegacyHunk' => 'DifferentialHunk',
'DifferentialLintField' => 'DifferentialCustomField',
'DifferentialLocalCommitsView' => 'AphrontView',
- 'DifferentialMail' => 'PhabricatorMail',
'DifferentialManiphestTasksField' => 'DifferentialCoreCustomField',
'DifferentialModernHunk' => 'DifferentialHunk',
'DifferentialParseCacheGarbageCollector' => 'PhabricatorGarbageCollector',
@@ -4229,7 +4228,7 @@
'LegalpadDocumentSignatureSearchEngine' => 'PhabricatorApplicationSearchEngine',
'LegalpadDocumentSignatureVerificationController' => 'LegalpadController',
'LegalpadDocumentSignatureViewController' => 'LegalpadController',
- 'LegalpadMockMailReceiver' => 'PhabricatorObjectMailReceiver',
+ 'LegalpadMailReceiver' => 'PhabricatorObjectMailReceiver',
'LegalpadObjectNeedsSignatureEdgeType' => 'PhabricatorEdgeType',
'LegalpadReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
'LegalpadSchemaSpec' => 'PhabricatorConfigSchemaSpec',
diff --git a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php
--- a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php
+++ b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php
@@ -38,12 +38,6 @@
return array_keys($phids);
}
- public static function newReplyHandlerForCommit($commit) {
- $reply_handler = new PhabricatorAuditReplyHandler();
- $reply_handler->setMailReceiver($commit);
- return $reply_handler;
- }
-
public static function getMailThreading(
PhabricatorRepository $repository,
PhabricatorRepositoryCommit $commit) {
diff --git a/src/applications/audit/mail/PhabricatorAuditMailReceiver.php b/src/applications/audit/mail/PhabricatorAuditMailReceiver.php
--- a/src/applications/audit/mail/PhabricatorAuditMailReceiver.php
+++ b/src/applications/audit/mail/PhabricatorAuditMailReceiver.php
@@ -21,17 +21,8 @@
->executeOne();
}
- protected function processReceivedObjectMail(
- PhabricatorMetaMTAReceivedMail $mail,
- PhabricatorLiskDAO $object,
- PhabricatorUser $sender) {
-
- $handler = PhabricatorAuditCommentEditor::newReplyHandlerForCommit($object);
-
- $handler->setActor($sender);
- $handler->setExcludeMailRecipientPHIDs(
- $mail->loadExcludeMailRecipientPHIDs());
- $handler->processEmail($mail);
+ protected function getTransactionReplyHandler() {
+ return new PhabricatorAuditReplyHandler();
}
}
diff --git a/src/applications/conpherence/application/PhabricatorConpherenceApplication.php b/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
--- a/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
+++ b/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
@@ -65,4 +65,14 @@
);
}
+ 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();
+ }
+
}
diff --git a/src/applications/conpherence/mail/ConpherenceThreadMailReceiver.php b/src/applications/conpherence/mail/ConpherenceThreadMailReceiver.php
--- a/src/applications/conpherence/mail/ConpherenceThreadMailReceiver.php
+++ b/src/applications/conpherence/mail/ConpherenceThreadMailReceiver.php
@@ -23,18 +23,8 @@
->executeOne();
}
- protected function processReceivedObjectMail(
- PhabricatorMetaMTAReceivedMail $mail,
- PhabricatorLiskDAO $object,
- PhabricatorUser $sender) {
-
- $handler = id(new ConpherenceReplyHandler())
- ->setMailReceiver($object);
-
- $handler->setActor($sender);
- $handler->setExcludeMailRecipientPHIDs(
- $mail->loadExcludeMailRecipientPHIDs());
- $handler->processEmail($mail);
+ protected function getTransactionReplyHandler() {
+ return new ConpherenceReplyHandler();
}
}
diff --git a/src/applications/conpherence/storage/ConpherenceThread.php b/src/applications/conpherence/storage/ConpherenceThread.php
--- a/src/applications/conpherence/storage/ConpherenceThread.php
+++ b/src/applications/conpherence/storage/ConpherenceThread.php
@@ -1,7 +1,9 @@
<?php
final class ConpherenceThread extends ConpherenceDAO
- implements PhabricatorPolicyInterface {
+ implements
+ PhabricatorPolicyInterface,
+ PhabricatorApplicationTransactionInterface {
protected $title;
protected $isRoom = 0;
@@ -290,4 +292,26 @@
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;
+ }
+
}
diff --git a/src/applications/differential/mail/DifferentialMail.php b/src/applications/differential/mail/DifferentialMail.php
deleted file mode 100644
--- a/src/applications/differential/mail/DifferentialMail.php
+++ /dev/null
@@ -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;
- }
-
-}
diff --git a/src/applications/differential/mail/DifferentialRevisionMailReceiver.php b/src/applications/differential/mail/DifferentialRevisionMailReceiver.php
--- a/src/applications/differential/mail/DifferentialRevisionMailReceiver.php
+++ b/src/applications/differential/mail/DifferentialRevisionMailReceiver.php
@@ -24,17 +24,8 @@
->executeOne();
}
- protected function processReceivedObjectMail(
- PhabricatorMetaMTAReceivedMail $mail,
- PhabricatorLiskDAO $object,
- PhabricatorUser $sender) {
-
- $handler = DifferentialMail::newReplyHandlerForRevision($object);
-
- $handler->setActor($sender);
- $handler->setExcludeMailRecipientPHIDs(
- $mail->loadExcludeMailRecipientPHIDs());
- $handler->processEmail($mail);
+ protected function getTransactionReplyHandler() {
+ return new DifferentialReplyHandler();
}
}
diff --git a/src/applications/diffusion/application/PhabricatorDiffusionApplication.php b/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
--- a/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
+++ b/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
@@ -148,4 +148,17 @@
);
}
+ 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.'),
+ ),
+ );
+ }
+
}
diff --git a/src/applications/files/application/PhabricatorFilesApplication.php b/src/applications/files/application/PhabricatorFilesApplication.php
--- a/src/applications/files/application/PhabricatorFilesApplication.php
+++ b/src/applications/files/application/PhabricatorFilesApplication.php
@@ -96,4 +96,17 @@
);
}
+ 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.'),
+ ),
+ );
+ }
+
}
diff --git a/src/applications/files/mail/FileMailReceiver.php b/src/applications/files/mail/FileMailReceiver.php
--- a/src/applications/files/mail/FileMailReceiver.php
+++ b/src/applications/files/mail/FileMailReceiver.php
@@ -20,18 +20,8 @@
->executeOne();
}
- protected function processReceivedObjectMail(
- PhabricatorMetaMTAReceivedMail $mail,
- PhabricatorLiskDAO $object,
- PhabricatorUser $sender) {
-
- $handler = id(new FileReplyHandler())
- ->setMailReceiver($object);
-
- $handler->setActor($sender);
- $handler->setExcludeMailRecipientPHIDs(
- $mail->loadExcludeMailRecipientPHIDs());
- $handler->processEmail($mail);
+ protected function getTransactionReplyHandler() {
+ return new FileReplyHandler();
}
}
diff --git a/src/applications/legalpad/application/PhabricatorLegalpadApplication.php b/src/applications/legalpad/application/PhabricatorLegalpadApplication.php
--- a/src/applications/legalpad/application/PhabricatorLegalpadApplication.php
+++ b/src/applications/legalpad/application/PhabricatorLegalpadApplication.php
@@ -80,4 +80,17 @@
);
}
+ 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.'),
+ ),
+ );
+ }
+
}
diff --git a/src/applications/legalpad/mail/LegalpadMockMailReceiver.php b/src/applications/legalpad/mail/LegalpadMailReceiver.php
rename from src/applications/legalpad/mail/LegalpadMockMailReceiver.php
rename to src/applications/legalpad/mail/LegalpadMailReceiver.php
--- a/src/applications/legalpad/mail/LegalpadMockMailReceiver.php
+++ b/src/applications/legalpad/mail/LegalpadMailReceiver.php
@@ -1,6 +1,6 @@
<?php
-final class LegalpadMockMailReceiver extends PhabricatorObjectMailReceiver {
+final class LegalpadMailReceiver extends PhabricatorObjectMailReceiver {
public function isEnabled() {
$app_class = 'PhabricatorLegalpadApplication';
@@ -21,18 +21,8 @@
->executeOne();
}
- protected function processReceivedObjectMail(
- PhabricatorMetaMTAReceivedMail $mail,
- PhabricatorLiskDAO $object,
- PhabricatorUser $sender) {
-
- $handler = id(new LegalpadReplyHandler())
- ->setMailReceiver($object)
- ->setActor($sender)
- ->setExcludeMailRecipientPHIDs(
- $mail->loadExcludeMailRecipientPHIDs());
-
- return $handler->processEmail($mail);
+ protected function getTransactionReplyHandler() {
+ return new LegalpadReplyHandler();
}
}
diff --git a/src/applications/macro/application/PhabricatorMacroApplication.php b/src/applications/macro/application/PhabricatorMacroApplication.php
--- a/src/applications/macro/application/PhabricatorMacroApplication.php
+++ b/src/applications/macro/application/PhabricatorMacroApplication.php
@@ -57,4 +57,17 @@
);
}
+ 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.'),
+ ),
+ );
+ }
+
}
diff --git a/src/applications/macro/mail/PhabricatorMacroMailReceiver.php b/src/applications/macro/mail/PhabricatorMacroMailReceiver.php
--- a/src/applications/macro/mail/PhabricatorMacroMailReceiver.php
+++ b/src/applications/macro/mail/PhabricatorMacroMailReceiver.php
@@ -20,13 +20,8 @@
->executeOne();
}
- protected function processReceivedObjectMail(
- PhabricatorMetaMTAReceivedMail $mail,
- PhabricatorLiskDAO $object,
- PhabricatorUser $sender) {
-
- // TODO: For now, we just drop this mail on the floor.
-
+ protected function getTransactionReplyHandler() {
+ return new PhabricatorMacroReplyHandler();
}
}
diff --git a/src/applications/maniphest/mail/ManiphestTaskMailReceiver.php b/src/applications/maniphest/mail/ManiphestTaskMailReceiver.php
--- a/src/applications/maniphest/mail/ManiphestTaskMailReceiver.php
+++ b/src/applications/maniphest/mail/ManiphestTaskMailReceiver.php
@@ -24,18 +24,8 @@
return head($results);
}
- protected function processReceivedObjectMail(
- PhabricatorMetaMTAReceivedMail $mail,
- PhabricatorLiskDAO $object,
- PhabricatorUser $sender) {
-
- $handler = new ManiphestReplyHandler();
- $handler->setMailReceiver($object);
-
- $handler->setActor($sender);
- $handler->setExcludeMailRecipientPHIDs(
- $mail->loadExcludeMailRecipientPHIDs());
- $handler->processEmail($mail);
+ protected function getTransactionReplyHandler() {
+ return new ManiphestReplyHandler();
}
}
diff --git a/src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php b/src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php
--- a/src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php
+++ b/src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php
@@ -39,10 +39,26 @@
return $this;
}
- abstract protected function processReceivedObjectMail(
+ protected function processReceivedObjectMail(
PhabricatorMetaMTAReceivedMail $mail,
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) {
return $this->loadObject($pattern, $viewer);
diff --git a/src/applications/paste/application/PhabricatorPasteApplication.php b/src/applications/paste/application/PhabricatorPasteApplication.php
--- a/src/applications/paste/application/PhabricatorPasteApplication.php
+++ b/src/applications/paste/application/PhabricatorPasteApplication.php
@@ -82,4 +82,17 @@
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.'),
+ ),
+ );
+ }
+
}
diff --git a/src/applications/paste/mail/PasteMailReceiver.php b/src/applications/paste/mail/PasteMailReceiver.php
--- a/src/applications/paste/mail/PasteMailReceiver.php
+++ b/src/applications/paste/mail/PasteMailReceiver.php
@@ -20,18 +20,8 @@
->executeOne();
}
- protected function processReceivedObjectMail(
- PhabricatorMetaMTAReceivedMail $mail,
- PhabricatorLiskDAO $object,
- PhabricatorUser $sender) {
-
- $handler = id(new PasteReplyHandler())
- ->setMailReceiver($object);
-
- $handler->setActor($sender);
- $handler->setExcludeMailRecipientPHIDs(
- $mail->loadExcludeMailRecipientPHIDs());
- $handler->processEmail($mail);
+ protected function getTransactionReplyHandler() {
+ return new PasteReplyHandler();
}
}
diff --git a/src/applications/pholio/application/PhabricatorPholioApplication.php b/src/applications/pholio/application/PhabricatorPholioApplication.php
--- a/src/applications/pholio/application/PhabricatorPholioApplication.php
+++ b/src/applications/pholio/application/PhabricatorPholioApplication.php
@@ -77,4 +77,17 @@
);
}
+ 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.'),
+ ),
+ );
+ }
+
}
diff --git a/src/applications/pholio/mail/PholioMockMailReceiver.php b/src/applications/pholio/mail/PholioMockMailReceiver.php
--- a/src/applications/pholio/mail/PholioMockMailReceiver.php
+++ b/src/applications/pholio/mail/PholioMockMailReceiver.php
@@ -20,12 +20,8 @@
->executeOne();
}
- protected function processReceivedObjectMail(
- PhabricatorMetaMTAReceivedMail $mail,
- PhabricatorLiskDAO $object,
- PhabricatorUser $sender) {
-
- // TODO: For now, we just drop this mail on the floor.
+ protected function getTransactionReplyHandler() {
+ return new PholioReplyHandler();
}
}
diff --git a/src/applications/ponder/application/PhabricatorPonderApplication.php b/src/applications/ponder/application/PhabricatorPonderApplication.php
--- a/src/applications/ponder/application/PhabricatorPonderApplication.php
+++ b/src/applications/ponder/application/PhabricatorPonderApplication.php
@@ -66,4 +66,17 @@
);
}
+ 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.'),
+ ),
+ );
+ }
+
}
diff --git a/src/applications/ponder/mail/PonderQuestionMailReceiver.php b/src/applications/ponder/mail/PonderQuestionMailReceiver.php
--- a/src/applications/ponder/mail/PonderQuestionMailReceiver.php
+++ b/src/applications/ponder/mail/PonderQuestionMailReceiver.php
@@ -20,13 +20,8 @@
->executeOne();
}
- protected function processReceivedObjectMail(
- PhabricatorMetaMTAReceivedMail $mail,
- PhabricatorLiskDAO $object,
- PhabricatorUser $sender) {
-
- // TODO: For now, we just drop this mail on the floor.
-
+ protected function getTransactionReplyHandler() {
+ return new PonderQuestionReplyHandler();
}
}
diff --git a/src/applications/releeph/application/PhabricatorReleephApplication.php b/src/applications/releeph/application/PhabricatorReleephApplication.php
--- a/src/applications/releeph/application/PhabricatorReleephApplication.php
+++ b/src/applications/releeph/application/PhabricatorReleephApplication.php
@@ -78,4 +78,11 @@
);
}
+ 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();
+ }
+
}
diff --git a/src/applications/releeph/mail/ReleephRequestMailReceiver.php b/src/applications/releeph/mail/ReleephRequestMailReceiver.php
--- a/src/applications/releeph/mail/ReleephRequestMailReceiver.php
+++ b/src/applications/releeph/mail/ReleephRequestMailReceiver.php
@@ -20,13 +20,8 @@
->executeOne();
}
- protected function processReceivedObjectMail(
- PhabricatorMetaMTAReceivedMail $mail,
- PhabricatorLiskDAO $object,
- PhabricatorUser $sender) {
-
- // TODO: For now, we just drop this mail on the floor.
-
+ protected function getTransactionReplyHandler() {
+ return new ReleephRequestReplyHandler();
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 15 2024, 11:38 PM (4 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6714897
Default Alt Text
D12249.diff (21 KB)
Attached To
Mode
D12249: Expose all application mail receivers
Attached
Detach File
Event Timeline
Log In to Comment