1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-11 15:21:03 +01:00

Remove inconsistent and confusing use of the term "multiplex" in mail

Summary:
Ref T13053. Because I previously misunderstood what "multiplex" means, I used it in various contradictory and inconsistent ways.

We can send mail in two ways: either one mail to everyone with a big "To" and a big "Cc" (not default; better for mailing lists) or one mail to each recipient with just them in "To" (default; better for almost everything else).

"Multiplexing" is combining multiple signals over a single channel, so it more accurately describes the big to/cc. However, it is sometimes used to descibe the other approach. Since it's ambiguous and I've tainted it through misuse, get rid of it and use more clear language.

(There's still some likely misuse in the SMS stuff, and a couple of legitimate uses in other contexts.)

Test Plan: Grepped for `multiplex`, saw less of it.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13053

Differential Revision: https://secure.phabricator.com/D18994
This commit is contained in:
epriestley 2018-02-05 10:37:39 -08:00
parent c3f95bc410
commit 9de54aedb5
5 changed files with 12 additions and 12 deletions

View file

@ -153,9 +153,9 @@ EODOC
$adapter_doc_name)); $adapter_doc_name));
$placeholder_description = $this->deformat(pht(<<<EODOC $placeholder_description = $this->deformat(pht(<<<EODOC
When sending a message that has no To recipient (i.e. all recipients are CC'd, When sending a message that has no To recipient (i.e. all recipients are CC'd),
for example when multiplexing mail), set the To field to the following value. If set the To field to the following value. If no value is set, messages with no
no value is set, messages with no To will have their CCs upgraded to To. To will have their CCs upgraded to To.
EODOC EODOC
)); ));

View file

@ -19,8 +19,8 @@ final class PhabricatorMailImplementationPHPMailerAdapter
$this->mailer->Encoding = $encoding; $this->mailer->Encoding = $encoding;
// By default, PHPMailer sends one mail per recipient. We handle // By default, PHPMailer sends one mail per recipient. We handle
// multiplexing higher in the stack, so tell it to send mail exactly // combining or separating To and Cc higher in the stack, so tell it to
// like we ask. // send mail exactly like we ask.
$this->mailer->SingleTo = false; $this->mailer->SingleTo = false;
$mailer = PhabricatorEnv::getEnvConfig('phpmailer.mailer'); $mailer = PhabricatorEnv::getEnvConfig('phpmailer.mailer');

View file

@ -22,8 +22,8 @@ class PhabricatorMailImplementationPHPMailerLiteAdapter
$this->mailer->Encoding = $encoding; $this->mailer->Encoding = $encoding;
// By default, PHPMailerLite sends one mail per recipient. We handle // By default, PHPMailerLite sends one mail per recipient. We handle
// multiplexing higher in the stack, so tell it to send mail exactly // combining or separating To and Cc higher in the stack, so tell it to
// like we ask. // send mail exactly like we ask.
$this->mailer->SingleTo = false; $this->mailer->SingleTo = false;
} }

View file

@ -507,8 +507,8 @@ final class PhabricatorMetaMTAMail
$add_cc = array(); $add_cc = array();
$add_to = array(); $add_to = array();
// If multiplexing is enabled, some recipients will be in "Cc" // If we're sending one mail to everyone, some recipients will be in
// rather than "To". We'll move them to "To" later (or supply a // "Cc" rather than "To". We'll move them to "To" later (or supply a
// dummy "To") but need to look for the recipient in either the // dummy "To") but need to look for the recipient in either the
// "To" or "Cc" fields here. // "To" or "Cc" fields here.
$target_phid = head(idx($params, 'to', array())); $target_phid = head(idx($params, 'to', array()));
@ -847,7 +847,7 @@ final class PhabricatorMetaMTAMail
return base64_encode($base); return base64_encode($base);
} }
public static function shouldMultiplexAllMail() { public static function shouldMailEachRecipient() {
return PhabricatorEnv::getEnvConfig('metamta.one-mail-per-recipient'); return PhabricatorEnv::getEnvConfig('metamta.one-mail-per-recipient');
} }
@ -1290,7 +1290,7 @@ final class PhabricatorMetaMTAMail
private function loadPreferences($target_phid) { private function loadPreferences($target_phid) {
$viewer = PhabricatorUser::getOmnipotentUser(); $viewer = PhabricatorUser::getOmnipotentUser();
if (self::shouldMultiplexAllMail()) { if (self::shouldMailEachRecipient()) {
$preferences = id(new PhabricatorUserPreferencesQuery()) $preferences = id(new PhabricatorUserPreferencesQuery())
->setViewer($viewer) ->setViewer($viewer)
->withUserPHIDs(array($target_phid)) ->withUserPHIDs(array($target_phid))

View file

@ -14,7 +14,7 @@ final class PhabricatorEmailFormatSettingsPanel
} }
public function isUserPanel() { public function isUserPanel() {
return PhabricatorMetaMTAMail::shouldMultiplexAllMail(); return PhabricatorMetaMTAMail::shouldMailEachRecipient();
} }
public function isManagementPanel() { public function isManagementPanel() {