Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/editor/PhamePostEditor.php
Show First 20 Lines • Show All 203 Lines • ▼ Show 20 Lines | final class PhamePostEditor | ||||
} | } | ||||
protected function buildMailBody( | protected function buildMailBody( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
array $xactions) { | array $xactions) { | ||||
$body = parent::buildMailBody($object, $xactions); | $body = parent::buildMailBody($object, $xactions); | ||||
// We don't send mail if the object is a draft, and we only want | |||||
// to include the full body of the post on the either the | |||||
// first creation or if it was created as a draft, once it goes live. | |||||
if ($this->getIsNewObject()) { | if ($this->getIsNewObject()) { | ||||
$body->addRemarkupSection(null, $object->getBody()); | $body->addRemarkupSection(null, $object->getBody()); | ||||
} else { | |||||
foreach ($xactions as $xaction) { | |||||
switch ($xaction->getTransactionType()) { | |||||
case PhamePostTransaction::TYPE_VISIBILITY: | |||||
if (!$object->isDraft()) { | |||||
$body->addRemarkupSection(null, $object->getBody()); | |||||
} | |||||
break; | |||||
} | |||||
} | |||||
} | } | ||||
$body->addLinkSection( | $body->addLinkSection( | ||||
pht('POST DETAIL'), | pht('POST DETAIL'), | ||||
PhabricatorEnv::getProductionURI($object->getViewURI())); | PhabricatorEnv::getProductionURI($object->getViewURI())); | ||||
return $body; | return $body; | ||||
} | } | ||||
Show All 21 Lines |