diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -3406,8 +3406,10 @@ 'PonderAnswerEditor' => 'applications/ponder/editor/PonderAnswerEditor.php', 'PonderAnswerHasVotingUserEdgeType' => 'applications/ponder/edge/PonderAnswerHasVotingUserEdgeType.php', 'PonderAnswerHistoryController' => 'applications/ponder/controller/PonderAnswerHistoryController.php', + 'PonderAnswerMailReceiver' => 'applications/ponder/mail/PonderAnswerMailReceiver.php', 'PonderAnswerPHIDType' => 'applications/ponder/phid/PonderAnswerPHIDType.php', 'PonderAnswerQuery' => 'applications/ponder/query/PonderAnswerQuery.php', + 'PonderAnswerReplyHandler' => 'applications/ponder/mail/PonderAnswerReplyHandler.php', 'PonderAnswerSaveController' => 'applications/ponder/controller/PonderAnswerSaveController.php', 'PonderAnswerStatus' => 'applications/ponder/constants/PonderAnswerStatus.php', 'PonderAnswerTransaction' => 'applications/ponder/storage/PonderAnswerTransaction.php', @@ -3442,7 +3444,6 @@ 'PonderRemarkupRule' => 'applications/ponder/remarkup/PonderRemarkupRule.php', 'PonderSchemaSpec' => 'applications/ponder/storage/PonderSchemaSpec.php', 'PonderSearchIndexer' => 'applications/ponder/search/PonderSearchIndexer.php', - 'PonderTransactionFeedStory' => 'applications/ponder/feed/PonderTransactionFeedStory.php', 'PonderVotableInterface' => 'applications/ponder/storage/PonderVotableInterface.php', 'PonderVote' => 'applications/ponder/constants/PonderVote.php', 'PonderVoteEditor' => 'applications/ponder/editor/PonderVoteEditor.php', @@ -7607,8 +7608,10 @@ 'PonderAnswerEditor' => 'PonderEditor', 'PonderAnswerHasVotingUserEdgeType' => 'PhabricatorEdgeType', 'PonderAnswerHistoryController' => 'PonderController', + 'PonderAnswerMailReceiver' => 'PhabricatorObjectMailReceiver', 'PonderAnswerPHIDType' => 'PhabricatorPHIDType', 'PonderAnswerQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', + 'PonderAnswerReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler', 'PonderAnswerSaveController' => 'PonderController', 'PonderAnswerStatus' => 'PonderConstants', 'PonderAnswerTransaction' => 'PhabricatorApplicationTransaction', @@ -7654,7 +7657,6 @@ 'PonderRemarkupRule' => 'PhabricatorObjectRemarkupRule', 'PonderSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PonderSearchIndexer' => 'PhabricatorSearchDocumentIndexer', - 'PonderTransactionFeedStory' => 'PhabricatorApplicationTransactionFeedStory', 'PonderVote' => 'PonderConstants', 'PonderVoteEditor' => 'PhabricatorEditor', 'PonderVotingUserHasAnswerEdgeType' => 'PhabricatorEdgeType', diff --git a/src/applications/ponder/editor/PonderQuestionEditor.php b/src/applications/ponder/editor/PonderQuestionEditor.php --- a/src/applications/ponder/editor/PonderQuestionEditor.php +++ b/src/applications/ponder/editor/PonderQuestionEditor.php @@ -177,30 +177,13 @@ return true; } - protected function getFeedStoryType() { - return 'PonderTransactionFeedStory'; - } - - protected function getFeedStoryData( - PhabricatorLiskDAO $object, - array $xactions) { - - $data = parent::getFeedStoryData($object, $xactions); - $answer = $this->getAnswer(); - if ($answer) { - $data['answerPHID'] = $answer->getPHID(); - } - - return $data; - } - protected function shouldImplyCC( PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case PonderQuestionTransaction::TYPE_ANSWERS: - return true; + return false; } return parent::shouldImplyCC($object, $xaction); @@ -209,7 +192,25 @@ protected function shouldSendMail( PhabricatorLiskDAO $object, array $xactions) { - return true; + foreach ($xactions as $xaction) { + switch ($xaction->getTransactionType()) { + case PonderQuestionTransaction::TYPE_ANSWERS: + return false; + } + } + return true; + } + + protected function shouldPublishFeedStory( + PhabricatorLiskDAO $object, + array $xactions) { + foreach ($xactions as $xaction) { + switch ($xaction->getTransactionType()) { + case PonderQuestionTransaction::TYPE_ANSWERS: + return false; + } + } + return true; } public function getMailTagsMap() { @@ -248,14 +249,6 @@ $body->addRawSection($new); } } - // If the user gave an answer, add the answer text. Also update - // the header and uri to be more answer-specific. - if ($type == PonderQuestionTransaction::TYPE_ANSWERS) { - $answer = $this->getAnswer(); - $body->addRawSection($answer->getContent()); - $header = pht('ANSWER DETAIL'); - $uri = $answer->getURI(); - } } $body->addLinkSection( diff --git a/src/applications/ponder/feed/PonderTransactionFeedStory.php b/src/applications/ponder/feed/PonderTransactionFeedStory.php deleted file mode 100644 --- a/src/applications/ponder/feed/PonderTransactionFeedStory.php +++ /dev/null @@ -1,14 +0,0 @@ -getValue('answerPHID'); - if ($answer_phid) { - $phids[] = $answer_phid; - } - return $phids; - } -} diff --git a/src/applications/ponder/mail/PonderAnswerMailReceiver.php b/src/applications/ponder/mail/PonderAnswerMailReceiver.php new file mode 100644 --- /dev/null +++ b/src/applications/ponder/mail/PonderAnswerMailReceiver.php @@ -0,0 +1,27 @@ +setViewer($viewer) + ->withIDs(array($id)) + ->executeOne(); + } + + protected function getTransactionReplyHandler() { + return new PonderAnswerReplyHandler(); + } + +} diff --git a/src/applications/ponder/mail/PonderAnswerReplyHandler.php b/src/applications/ponder/mail/PonderAnswerReplyHandler.php new file mode 100644 --- /dev/null +++ b/src/applications/ponder/mail/PonderAnswerReplyHandler.php @@ -0,0 +1,16 @@ +getNewAnswerPHID(); - if ($answer_phid) { - return $story->getObject($answer_phid); - } - } - return null; - } - }