Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/editor/ConpherenceEditor.php
| Show First 20 Lines • Show All 527 Lines • ▼ Show 20 Lines | protected function buildMailTemplate(PhabricatorLiskDAO $object) { | ||||
| return id(new PhabricatorMetaMTAMail()) | return id(new PhabricatorMetaMTAMail()) | ||||
| ->setSubject("Z{$id}: {$title}") | ->setSubject("Z{$id}: {$title}") | ||||
| ->addHeader('Thread-Topic', "Z{$id}: {$phid}"); | ->addHeader('Thread-Topic', "Z{$id}: {$phid}"); | ||||
| } | } | ||||
| protected function getMailTo(PhabricatorLiskDAO $object) { | protected function getMailTo(PhabricatorLiskDAO $object) { | ||||
| $to_phids = array(); | $to_phids = array(); | ||||
| $participants = $object->getParticipants(); | $participants = $object->getParticipants(); | ||||
| if (empty($participants)) { | if (!$participants) { | ||||
| return $to_phids; | return $to_phids; | ||||
| } | } | ||||
| $preferences = id(new PhabricatorUserPreferences()) | |||||
| ->loadAllWhere('userPHID in (%Ls)', array_keys($participants)); | $participant_phids = mpull($participants, 'getParticipantPHID'); | ||||
| $preferences = id(new PhabricatorUserPreferencesQuery()) | |||||
| ->setViewer(PhabricatorUser::getOmnipotentUser()) | |||||
| ->withUserPHIDs($participant_phids) | |||||
| ->execute(); | |||||
| $preferences = mpull($preferences, null, 'getUserPHID'); | $preferences = mpull($preferences, null, 'getUserPHID'); | ||||
| foreach ($participants as $phid => $participant) { | foreach ($participants as $phid => $participant) { | ||||
| $default = ConpherenceSettings::EMAIL_ALWAYS; | $default = ConpherenceSettings::EMAIL_ALWAYS; | ||||
| $preference = idx($preferences, $phid); | $preference = idx($preferences, $phid); | ||||
| if ($preference) { | if ($preference) { | ||||
| $default = $preference->getPreference( | $default = $preference->getPreference( | ||||
| PhabricatorUserPreferences::PREFERENCE_CONPH_NOTIFICATIONS, | PhabricatorUserPreferences::PREFERENCE_CONPH_NOTIFICATIONS, | ||||
| ConpherenceSettings::EMAIL_ALWAYS); | ConpherenceSettings::EMAIL_ALWAYS); | ||||
| } | } | ||||
| $settings = $participant->getSettings(); | $settings = $participant->getSettings(); | ||||
| $notifications = idx( | $notifications = idx( | ||||
| $settings, | $settings, | ||||
| 'notifications', | 'notifications', | ||||
| $default); | $default); | ||||
| if ($notifications == ConpherenceSettings::EMAIL_ALWAYS) { | if ($notifications == ConpherenceSettings::EMAIL_ALWAYS) { | ||||
| $to_phids[] = $phid; | $to_phids[] = $phid; | ||||
| } | } | ||||
| } | } | ||||
| return $to_phids; | return $to_phids; | ||||
| } | } | ||||
| protected function getMailCC(PhabricatorLiskDAO $object) { | protected function getMailCC(PhabricatorLiskDAO $object) { | ||||
| return array(); | return array(); | ||||
| } | } | ||||
| protected function buildMailBody( | protected function buildMailBody( | ||||
| ▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines | |||||