1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Remove all application-specific reply handler class overrides

Summary:
Ref T7199. In the vein of D12231, these options were a bad idea.

  - They once served a very narrow, Facebook-specific need (see T1992), except even Facebook only used the Differential setting AFAIK.
  - Outside of that special case, they are unused and essentially unusable (generally speaking, they do not meaningfully implement anything modular or replaceable).
  - I have no knowledge of any install ever changing these settings, and can imagine no reason why they would.

Moving forward:

  - If they really need to, they can fork locally and chagne one line.
  - I expect "!actions" to make mail at least somewhat more modular soon, anyway.
  - Any derived handlers would break after T7199 and need to be rewritten anyway, so this is just taking advantage of a BC break to do cleanup.

Test Plan:
  - Grepped for removed configuration.
  - Sent some mail from applications, verified the reply handlers set proper reply addresses.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7199

Differential Revision: https://secure.phabricator.com/D12233
This commit is contained in:
epriestley 2015-03-31 17:22:01 -07:00
parent bad645f1ec
commit 34db543d27
11 changed files with 14 additions and 43 deletions

View file

@ -39,8 +39,7 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor {
}
public static function newReplyHandlerForCommit($commit) {
$reply_handler = PhabricatorEnv::newObjectFromConfig(
'metamta.diffusion.reply-handler');
$reply_handler = new PhabricatorAuditReplyHandler();
$reply_handler->setMailReceiver($commit);
return $reply_handler;
}

View file

@ -588,10 +588,8 @@ final class PhabricatorAuditEditor
return $result;
}
protected function buildReplyHandler(PhabricatorLiskDAO $object) {
$reply_handler = PhabricatorEnv::newObjectFromConfig(
'metamta.diffusion.reply-handler');
$reply_handler = new PhabricatorAuditReplyHandler();
$reply_handler->setMailReceiver($object);
return $reply_handler;
}

View file

@ -164,6 +164,9 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck {
'Configure a reply domain with "%s".',
'metamta.reply-handler-domain');
$reply_handler_reason = pht(
'Reply handlers can no longer be overridden with configuration.');
$ancient_config += array(
'phid.external-loaders' =>
pht(
@ -233,6 +236,11 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck {
'metamta.macro.reply-handler-domain' => $reply_domain_reason,
'metamta.maniphest.reply-handler-domain' => $reply_domain_reason,
'metamta.pholio.reply-handler-domain' => $reply_domain_reason,
'metamta.diffusion.reply-handler' => $reply_handler_reason,
'metamta.differential.reply-handler' => $reply_handler_reason,
'metamta.maniphest.reply-handler' => $reply_handler_reason,
'metamta.package.reply-handler' => $reply_handler_reason,
);
return $ancient_config;

View file

@ -244,13 +244,6 @@ final class PhabricatorDifferentialConfigOptions
pht(
"Similar to `differential.days-fresh` but marks stale revisions. ".
"If the revision is even older than it is when marked as 'old'.")),
$this->newOption(
'metamta.differential.reply-handler',
'class',
'DifferentialReplyHandler')
->setLocked(true)
->setBaseClass('PhabricatorMailReplyHandler')
->setDescription(pht('Alternate reply handler class.')),
$this->newOption(
'metamta.differential.subject-prefix',
'string',

View file

@ -4,11 +4,8 @@ abstract class DifferentialMail extends PhabricatorMail {
public static function newReplyHandlerForRevision(
DifferentialRevision $revision) {
$reply_handler = PhabricatorEnv::newObjectFromConfig(
'metamta.differential.reply-handler');
$reply_handler = new DifferentialReplyHandler();
$reply_handler->setMailReceiver($revision);
return $reply_handler;
}

View file

@ -26,13 +26,6 @@ final class PhabricatorDiffusionConfigOptions
'string',
'[Diffusion]')
->setDescription(pht('Subject prefix for Diffusion mail.')),
$this->newOption(
'metamta.diffusion.reply-handler',
'class',
'PhabricatorAuditReplyHandler')
->setLocked(true)
->setBaseClass('PhabricatorMailReplyHandler')
->setDescription(pht('Override mail reply handler class.')),
$this->newOption(
'metamta.diffusion.attach-patches',
'bool',

View file

@ -272,13 +272,6 @@ EOTEXT
'review and adjust available priorities by using the '.
'{{maniphest.priorities}} configuration option. The default value '.
'(`90`) corresponds to the default "Needs Triage" priority.')),
$this->newOption(
'metamta.maniphest.reply-handler',
'class',
'ManiphestReplyHandler')
->setLocked(true)
->setBaseClass('PhabricatorMailReplyHandler')
->setDescription(pht('Override reply handler class.')),
$this->newOption(
'metamta.maniphest.subject-prefix',
'string',

View file

@ -19,8 +19,7 @@ final class ManiphestCreateMailReceiver extends PhabricatorMailReceiver {
$task = ManiphestTask::initializeNewTask($sender);
$task->setOriginalEmailSource($mail->getHeader('From'));
$handler = PhabricatorEnv::newObjectFromConfig(
'metamta.maniphest.reply-handler');
$handler = new ManiphestReplyHandler();
$handler->setMailReceiver($task);
$handler->setActor($sender);

View file

@ -29,8 +29,7 @@ final class ManiphestTaskMailReceiver extends PhabricatorObjectMailReceiver {
PhabricatorLiskDAO $object,
PhabricatorUser $sender) {
$handler = PhabricatorEnv::newObjectFromConfig(
'metamta.maniphest.reply-handler');
$handler = new ManiphestReplyHandler();
$handler->setMailReceiver($object);
$handler->setActor($sender);

View file

@ -21,13 +21,6 @@ final class PhabricatorOwnersConfigOptions
public function getOptions() {
return array(
$this->newOption(
'metamta.package.reply-handler',
'class',
'OwnersPackageReplyHandler')
->setLocked(true)
->setBaseClass('PhabricatorMailReplyHandler')
->setDescription(pht('Reply handler for owners mail.')),
$this->newOption('metamta.package.subject-prefix', 'string', '[Package]')
->setDescription(pht('Subject prefix for Owners email.')),
);

View file

@ -201,8 +201,7 @@ abstract class PackageMail extends PhabricatorMail {
}
private function newReplyHandler() {
$reply_handler = PhabricatorEnv::newObjectFromConfig(
'metamta.package.reply-handler');
$reply_handler = new OwnersPackageReplyHandler();
$reply_handler->setMailReceiver($this->getPackage());
return $reply_handler;
}