1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-22 20:51:10 +01:00

Fix an issue with email "Re:" prefix

Summary: See detailed discussion in T1543.

Test Plan:
  - Enabled multiplexing.
  - Set user A to "enable Re".
  - Created a task owned by user B with user A cc'd.
  - Verified A got no "Re:" before this patch.
  - Applied patch.
  - Verified A got "Re:" after this patch.

Reviewers: nh, btrahan, vrana

Reviewed By: nh

CC: aran

Maniphest Tasks: T1543

Differential Revision: https://secure.phabricator.com/D3031
This commit is contained in:
epriestley 2012-07-23 09:23:54 -07:00
parent ac46ea39b8
commit 59db282624

View file

@ -448,12 +448,23 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
$prefs = null;
if ($use_prefs) {
$to = idx($params, 'to', array());
$user = id(new PhabricatorUser())->loadOneWhere(
'phid = %s',
head($to));
if ($user) {
$prefs = $user->loadPreferences();
// If multiplexing is enabled, some recipients will be in "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
// "To" or "Cc" fields here.
$target_phid = head(idx($params, 'to', array()));
if (!$target_phid) {
$target_phid = head(idx($params, 'cc', array()));
}
if ($target_phid) {
$user = id(new PhabricatorUser())->loadOneWhere(
'phid = %s',
$target_phid);
if ($user) {
$prefs = $user->loadPreferences();
}
}
}