Changeset View
Changeset View
Standalone View
Standalone View
src/applications/feed/PhabricatorFeedStoryPublisher.php
| Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | private function filterSubscribedPHIDs(array $phids) { | ||||
| if ($tags) { | if ($tags) { | ||||
| $all_prefs = id(new PhabricatorUserPreferencesQuery()) | $all_prefs = id(new PhabricatorUserPreferencesQuery()) | ||||
| ->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
| ->withUserPHIDs($phids) | ->withUserPHIDs($phids) | ||||
| ->execute(); | ->execute(); | ||||
| $all_prefs = mpull($all_prefs, null, 'getUserPHID'); | $all_prefs = mpull($all_prefs, null, 'getUserPHID'); | ||||
| } | } | ||||
| $pref_default = PhabricatorUserPreferences::MAILTAG_PREFERENCE_EMAIL; | $pref_default = PhabricatorEmailTagsSetting::VALUE_EMAIL; | ||||
| $pref_ignore = PhabricatorUserPreferences::MAILTAG_PREFERENCE_IGNORE; | $pref_ignore = PhabricatorEmailTagsSetting::VALUE_IGNORE; | ||||
| $keep = array(); | $keep = array(); | ||||
| foreach ($phids as $phid) { | foreach ($phids as $phid) { | ||||
| if (($phid == $this->storyAuthorPHID) && !$this->getNotifyAuthor()) { | if (($phid == $this->storyAuthorPHID) && !$this->getNotifyAuthor()) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| if ($tags && isset($all_prefs[$phid])) { | if ($tags && isset($all_prefs[$phid])) { | ||||
| $mailtags = $all_prefs[$phid]->getPreference( | $mailtags = $all_prefs[$phid]->getSettingValue( | ||||
| PhabricatorUserPreferences::PREFERENCE_MAILTAGS, | PhabricatorEmailTagsSetting::SETTINGKEY); | ||||
| array()); | |||||
| $notify = false; | $notify = false; | ||||
| foreach ($tags as $tag) { | foreach ($tags as $tag) { | ||||
| // If this is set to "email" or "notify", notify the user. | // If this is set to "email" or "notify", notify the user. | ||||
| if ((int)idx($mailtags, $tag, $pref_default) != $pref_ignore) { | if ((int)idx($mailtags, $tag, $pref_default) != $pref_ignore) { | ||||
| $notify = true; | $notify = true; | ||||
| break; | break; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||