Differential D16042 Diff 38606 src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php
| Show First 20 Lines • Show All 331 Lines • ▼ Show 20 Lines | abstract class PhabricatorMailReplyHandler extends Phobject { | ||||
| * @return pair<wild, wild> Maps from PHIDs to users. | * @return pair<wild, wild> Maps from PHIDs to users. | ||||
| */ | */ | ||||
| private function loadRecipientUsers(array $to, array $cc) { | private function loadRecipientUsers(array $to, array $cc) { | ||||
| $to_result = array(); | $to_result = array(); | ||||
| $cc_result = array(); | $cc_result = array(); | ||||
| $all_phids = array_merge($to, $cc); | $all_phids = array_merge($to, $cc); | ||||
| if ($all_phids) { | if ($all_phids) { | ||||
| // We need user settings here because we'll check translations later | |||||
| // when generating mail. | |||||
| $users = id(new PhabricatorPeopleQuery()) | $users = id(new PhabricatorPeopleQuery()) | ||||
| ->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
| ->withPHIDs($all_phids) | ->withPHIDs($all_phids) | ||||
| ->needUserSettings(true) | |||||
| ->execute(); | ->execute(); | ||||
| $users = mpull($users, null, 'getPHID'); | $users = mpull($users, null, 'getPHID'); | ||||
| foreach ($to as $phid) { | foreach ($to as $phid) { | ||||
| if (isset($users[$phid])) { | if (isset($users[$phid])) { | ||||
| $to_result[$phid] = $users[$phid]; | $to_result[$phid] = $users[$phid]; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines | |||||