From cb7560d301724bdb83ebda8fb7f7d7d35aa506cc Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 14 Jun 2016 11:27:18 -0700 Subject: [PATCH] Remove "re prefix" and "vary subjects" config Summary: Ref T11098. There is no reason to maintain these as separate values now that they can be configured in global settings. Test Plan: - Hit and read setup issue. - Fiddled with settings. - I'll vet this more throughly in the next diff since I need to fix an issue with global defaults in mail and can explicitly test this at the same time. Reviewers: chad Reviewed By: chad Subscribers: eadler Maniphest Tasks: T11098 Differential Revision: https://secure.phabricator.com/D16117 --- .../check/PhabricatorExtraConfigSetupCheck.php | 7 +++++++ .../option/PhabricatorMetaMTAConfigOptions.php | 16 ---------------- .../metamta/storage/PhabricatorMetaMTAMail.php | 15 ++------------- .../setting/PhabricatorEmailRePrefixSetting.php | 2 +- 4 files changed, 10 insertions(+), 30 deletions(-) diff --git a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php index 99d3f9962b..1e2eaa5680 100644 --- a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php +++ b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php @@ -190,6 +190,10 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck { 'The Differential revision list view age UI elements have been removed '. 'to simplify the interface.'); + $global_settings_reason = pht( + 'The "Re: Prefix" and "Vary Subjects" settings are now configured '. + 'in global settings.'); + $ancient_config += array( 'phid.external-loaders' => pht( @@ -321,6 +325,9 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck { 'differential.days-fresh' => $stale_reason, 'differential.days-stale' => $stale_reason, + + 'metamta.re-prefix' => $global_settings_reason, + 'metamta.vary-subjects' => $global_settings_reason, ); return $ancient_config; diff --git a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php index 16bdb7e520..45604f6872 100644 --- a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php +++ b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php @@ -276,22 +276,6 @@ EODOC )) ->setSummary(pht('Show email preferences link in email.')) ->setDescription($email_preferences_description), - $this->newOption('metamta.re-prefix', 'bool', false) - ->setBoolOptions( - array( - pht('Force "Re:" Subject Prefix'), - pht('No "Re:" Subject Prefix'), - )) - ->setSummary(pht('Control "Re:" subject prefix, for Mail.app.')) - ->setDescription($re_prefix_description), - $this->newOption('metamta.vary-subjects', 'bool', true) - ->setBoolOptions( - array( - pht('Allow Varied Subjects'), - pht('Always Use the Same Thread Subject'), - )) - ->setSummary(pht('Control subject variance, for some mail clients.')) - ->setDescription($vary_subjects_description), $this->newOption('metamta.insecure-auth-with-reply-to', 'bool', false) ->setBoolOptions( array( diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php index dcc14f0cc1..ceea3f0429 100644 --- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php @@ -1131,27 +1131,16 @@ final class PhabricatorMetaMTAMail } private function shouldAddRePrefix(PhabricatorUserPreferences $preferences) { - $default_value = PhabricatorEnv::getEnvConfig('metamta.re-prefix'); - - $value = $preferences->getPreference( + $value = $preferences->getSettingValue( PhabricatorEmailRePrefixSetting::SETTINGKEY); - if ($value === null) { - return $default_value; - } return ($value == PhabricatorEmailRePrefixSetting::VALUE_RE_PREFIX); } private function shouldVarySubject(PhabricatorUserPreferences $preferences) { - $default_value = PhabricatorEnv::getEnvConfig('metamta.vary-subjects'); - - $value = $preferences->getPreference( + $value = $preferences->getSettingValue( PhabricatorEmailVarySubjectsSetting::SETTINGKEY); - if ($value === null) { - return $default_value; - } - return ($value == PhabricatorEmailVarySubjectsSetting::VALUE_VARY_SUBJECTS); } diff --git a/src/applications/settings/setting/PhabricatorEmailRePrefixSetting.php b/src/applications/settings/setting/PhabricatorEmailRePrefixSetting.php index 2a2f63b461..7b04ef80c3 100644 --- a/src/applications/settings/setting/PhabricatorEmailRePrefixSetting.php +++ b/src/applications/settings/setting/PhabricatorEmailRePrefixSetting.php @@ -39,7 +39,7 @@ final class PhabricatorEmailRePrefixSetting } public function getSettingDefaultValue() { - return self::VALUE_RE_PREFIX; + return self::VALUE_NO_PREFIX; } protected function getSelectOptions() {