Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/editor/ConpherenceEditor.php
| Show First 20 Lines • Show All 535 Lines • ▼ Show 20 Lines | protected function getMailTo(PhabricatorLiskDAO $object) { | ||||
| $participants = $object->getParticipants(); | $participants = $object->getParticipants(); | ||||
| if (!$participants) { | if (!$participants) { | ||||
| return $to_phids; | return $to_phids; | ||||
| } | } | ||||
| $participant_phids = mpull($participants, 'getParticipantPHID'); | $participant_phids = mpull($participants, 'getParticipantPHID'); | ||||
| $preferences = id(new PhabricatorUserPreferencesQuery()) | $users = id(new PhabricatorPeopleQuery()) | ||||
| ->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
| ->withUserPHIDs($participant_phids) | ->withPHIDs($participant_phids) | ||||
| ->needUserSettings(true) | |||||
| ->execute(); | ->execute(); | ||||
| $preferences = mpull($preferences, null, 'getUserPHID'); | $users = mpull($users, null, 'getPHID'); | ||||
| $notification_key = PhabricatorConpherenceNotificationsSetting::SETTINGKEY; | |||||
| $notification_email = | |||||
| PhabricatorConpherenceNotificationsSetting::VALUE_CONPHERENCE_EMAIL; | |||||
| foreach ($participants as $phid => $participant) { | foreach ($participants as $phid => $participant) { | ||||
| $default = ConpherenceSettings::EMAIL_ALWAYS; | $user = idx($users, $phid); | ||||
| $preference = idx($preferences, $phid); | if ($user) { | ||||
| if ($preference) { | $default = $user->getUserSetting($notification_key); | ||||
| $default = $preference->getPreference( | } else { | ||||
| PhabricatorUserPreferences::PREFERENCE_CONPH_NOTIFICATIONS, | $default = $notification_email; | ||||
| ConpherenceSettings::EMAIL_ALWAYS); | |||||
| } | } | ||||
| $settings = $participant->getSettings(); | $settings = $participant->getSettings(); | ||||
| $notifications = idx( | $notifications = idx($settings, 'notifications', $default); | ||||
| $settings, | |||||
| 'notifications', | if ($notifications == $notification_email) { | ||||
| $default); | |||||
| 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) { | ||||
| ▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines | |||||