From ae082c60338d3bbf166f75d25de5f8baa7a17ab7 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Tue, 29 Sep 2015 14:25:28 -0700 Subject: [PATCH] Make Ponder Emails a little more consistently delivered Summary: Ref T9271, maybe fixes it. This restores feed publishing for answers (broken in D13951) and sends the author of the question an email for new answers. Also, unsure how to pull all question subsribers to the answer email, or is it automagical? Test Plan: notchad asks a question, chad answers, log into notchad and see that mail was delivered, see feed story. Reviewers: epriestley Reviewed By: epriestley Subscribers: revi, Korvin Maniphest Tasks: T9271 Differential Revision: https://secure.phabricator.com/D14171 --- .../ponder/editor/PonderAnswerEditor.php | 21 +++++++++++++++++++ .../ponder/editor/PonderEditor.php | 7 ------- .../ponder/editor/PonderQuestionEditor.php | 7 +++++++ 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/applications/ponder/editor/PonderAnswerEditor.php b/src/applications/ponder/editor/PonderAnswerEditor.php index fdb5c48437..521c1948ed 100644 --- a/src/applications/ponder/editor/PonderAnswerEditor.php +++ b/src/applications/ponder/editor/PonderAnswerEditor.php @@ -85,6 +85,27 @@ final class PonderAnswerEditor extends PonderEditor { return true; } + protected function getMailTo(PhabricatorLiskDAO $object) { + $phids = array(); + $phids[] = $object->getAuthorPHID(); + $phids[] = $this->requireActor()->getPHID(); + + $question = id(new PonderQuestionQuery()) + ->setViewer($this->requireActor()) + ->withIDs(array($object->getQuestionID())) + ->executeOne(); + + $phids[] = $question->getAuthorPHID(); + + return $phids; + } + + protected function shouldPublishFeedStory( + PhabricatorLiskDAO $object, + array $xactions) { + return true; + } + protected function buildReplyHandler(PhabricatorLiskDAO $object) { return id(new PonderAnswerReplyHandler()) ->setMailReceiver($object); diff --git a/src/applications/ponder/editor/PonderEditor.php b/src/applications/ponder/editor/PonderEditor.php index 24c6f2d8d2..fcfa981f16 100644 --- a/src/applications/ponder/editor/PonderEditor.php +++ b/src/applications/ponder/editor/PonderEditor.php @@ -7,13 +7,6 @@ abstract class PonderEditor return 'PhabricatorPonderApplication'; } - protected function getMailTo(PhabricatorLiskDAO $object) { - return array( - $object->getAuthorPHID(), - $this->requireActor()->getPHID(), - ); - } - protected function getMailSubjectPrefix() { return '[Ponder]'; } diff --git a/src/applications/ponder/editor/PonderQuestionEditor.php b/src/applications/ponder/editor/PonderQuestionEditor.php index b2f143b176..73d9ed0ce0 100644 --- a/src/applications/ponder/editor/PonderQuestionEditor.php +++ b/src/applications/ponder/editor/PonderQuestionEditor.php @@ -209,6 +209,13 @@ final class PonderQuestionEditor return true; } + protected function getMailTo(PhabricatorLiskDAO $object) { + return array( + $object->getAuthorPHID(), + $this->requireActor()->getPHID(), + ); + } + protected function shouldPublishFeedStory( PhabricatorLiskDAO $object, array $xactions) {