3 final class PonderAnswerEditor
extends PonderEditor
{
5 public function getEditorObjectsDescription() {
6 return pht('Ponder Answers');
9 public function getCreateObjectTitle($author, $object) {
10 return pht('%s added this answer.', $author);
13 public function getCreateObjectTitleForFeed($author, $object) {
14 return pht('%s added %s.', $author, $object);
17 public function getTransactionTypes() {
18 $types = parent
::getTransactionTypes();
19 $types[] = PhabricatorTransactions
::TYPE_COMMENT
;
24 protected function shouldSendMail(
25 PhabricatorLiskDAO
$object,
30 protected function getMailTo(PhabricatorLiskDAO
$object) {
32 $phids[] = $object->getAuthorPHID();
33 $phids[] = $this->requireActor()->getPHID();
35 $question = id(new PonderQuestionQuery())
36 ->setViewer($this->requireActor())
37 ->withIDs(array($object->getQuestionID()))
40 $phids[] = $question->getAuthorPHID();
45 protected function shouldPublishFeedStory(
46 PhabricatorLiskDAO
$object,
51 protected function buildReplyHandler(PhabricatorLiskDAO
$object) {
52 return id(new PonderAnswerReplyHandler())
53 ->setMailReceiver($object);
56 protected function buildMailTemplate(PhabricatorLiskDAO
$object) {
57 $id = $object->getID();
59 return id(new PhabricatorMetaMTAMail())
60 ->setSubject("ANSR{$id}");
63 protected function buildMailBody(
64 PhabricatorLiskDAO
$object,
67 $body = parent
::buildMailBody($object, $xactions);
69 // If the user just gave the answer, add the answer text.
70 foreach ($xactions as $xaction) {
71 $type = $xaction->getTransactionType();
72 $new = $xaction->getNewValue();
73 if ($type == PonderAnswerContentTransaction
::TRANSACTIONTYPE
) {
74 $body->addRawSection($new);
78 $body->addLinkSection(
80 PhabricatorEnv
::getProductionURI($object->getURI()));