Summary: Moves all remaining mail handling into ReplyHandlers. Farewell, `getPhabricatorToInformation()`! You were a bad method and no one liked you. Ref T1205. Test Plan: - Used test console to send mail to Revisions, Tasks, Conpherences and Commits (these all actually work). - Used test console to send mail to Requests, Macros, Questions and Mocks (these accept the mail but don't do anything with it, but didn't do anything before either). Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T1205 Differential Revision: https://secure.phabricator.com/D5953
33 lines
759 B
PHP
33 lines
759 B
PHP
<?php
|
|
|
|
final class PonderQuestionMailReceiver extends PhabricatorObjectMailReceiver {
|
|
|
|
public function isEnabled() {
|
|
$app_class = 'PhabricatorApplicationPonder';
|
|
return PhabricatorApplication::isClassInstalled($app_class);
|
|
}
|
|
|
|
protected function getObjectPattern() {
|
|
return 'Q[1-9]\d*';
|
|
}
|
|
|
|
protected function loadObject($pattern, PhabricatorUser $viewer) {
|
|
$id = (int)trim($pattern, 'Q');
|
|
|
|
return id(new PonderQuestionQuery())
|
|
->setViewer($viewer)
|
|
->withIDs(array($id))
|
|
->executeOne();
|
|
}
|
|
|
|
protected function processReceivedObjectMail(
|
|
PhabricatorMetaMTAReceivedMail $mail,
|
|
PhabricatorLiskDAO $object,
|
|
PhabricatorUser $sender) {
|
|
|
|
// TODO: For now, we just drop this mail on the floor.
|
|
|
|
}
|
|
|
|
}
|