Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/editor/PhamePostEditor.php
Show First 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | switch ($type) { | ||||
break; | break; | ||||
} | } | ||||
return $errors; | return $errors; | ||||
} | } | ||||
protected function shouldSendMail( | protected function shouldSendMail( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
array $xactions) { | array $xactions) { | ||||
if ($object->isDraft()) { | if ($object->isDraft() || ($object->isArchived())) { | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
protected function shouldPublishFeedStory( | protected function shouldPublishFeedStory( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
array $xactions) { | array $xactions) { | ||||
if ($object->isDraft()) { | if ($object->isDraft() || $object->isArchived()) { | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
protected function getMailTo(PhabricatorLiskDAO $object) { | protected function getMailTo(PhabricatorLiskDAO $object) { | ||||
$phids = array(); | $phids = array(); | ||||
$phids[] = $object->getBloggerPHID(); | $phids[] = $object->getBloggerPHID(); | ||||
Show All 34 Lines | protected function buildMailBody( | ||||
// to include the full body of the post on the either the | // 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. | // 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 { | } else { | ||||
foreach ($xactions as $xaction) { | foreach ($xactions as $xaction) { | ||||
switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
case PhamePostTransaction::TYPE_VISIBILITY: | case PhamePostTransaction::TYPE_VISIBILITY: | ||||
if (!$object->isDraft()) { | if (!$object->isDraft() && !$object->isArchived()) { | ||||
$body->addRemarkupSection(null, $object->getBody()); | $body->addRemarkupSection(null, $object->getBody()); | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
$body->addLinkSection( | $body->addLinkSection( | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |