From e3567b2d4dec61b0b0874b4302587304894fa3f5 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 28 Feb 2013 16:38:40 -0800 Subject: [PATCH] Fix grossness in Herald daemon Summary: Do this in a reasonably proper / formal way. Leave a TODO for the policy stuff. Test Plan: Ran `scripts/repository/reparse.php --herald rPnnnnn` Reviewers: vrana Reviewed By: vrana CC: aran Maniphest Tasks: T603 Differential Revision: https://secure.phabricator.com/D5150 --- .../PhabricatorRepositoryCommitHeraldWorker.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php b/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php index 66cace32fe..dfbf3a746e 100644 --- a/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php +++ b/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php @@ -77,14 +77,8 @@ final class PhabricatorRepositoryCommitHeraldWorker $commit->getPHID(), )); - // TODO: This is complicated and needs to be sorted out properly for - // repository policy stuff. We might need an omniscient user here? This - // fakes a logged-in user. - $viewer = id(new PhabricatorUser()) - ->setPHID('PHID-USER-XXX'); - $handles = id(new PhabricatorObjectHandleData($phids)) - ->setViewer($viewer) + ->setViewer(PhabricatorUser::getOmnipotentUser()) ->loadHandles(); $commit_handle = $handles[$commit->getPHID()]; @@ -158,6 +152,9 @@ final class PhabricatorRepositoryCommitHeraldWorker $template->setFrom($author_phid); } + // TODO: We should verify that each recipient can actually see the + // commit before sending them email (T603). + $mails = $reply_handler->multiplexMail( $template, id(new PhabricatorObjectHandleData($email_phids))->loadHandles(),