Differential D13219 Diff 32428 src/applications/transactions/feed/PhabricatorApplicationTransactionFeedStory.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/feed/PhabricatorApplicationTransactionFeedStory.php
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | public function renderText() { | ||||
$new_target = PhabricatorApplicationTransaction::TARGET_TEXT; | $new_target = PhabricatorApplicationTransaction::TARGET_TEXT; | ||||
$xaction->setRenderingTarget($new_target); | $xaction->setRenderingTarget($new_target); | ||||
$xaction->setHandles($this->getHandles()); | $xaction->setHandles($this->getHandles()); | ||||
$text = $xaction->getTitleForFeed(); | $text = $xaction->getTitleForFeed(); | ||||
$xaction->setRenderingTarget($old_target); | $xaction->setRenderingTarget($old_target); | ||||
return $text; | return $text; | ||||
} | } | ||||
public function renderTextBody() { | |||||
$all_bodies = ''; | |||||
$new_target = PhabricatorApplicationTransaction::TARGET_TEXT; | |||||
$xaction_phids = $this->getValue('transactionPHIDs'); | |||||
foreach ($xaction_phids as $xaction_phid) { | |||||
$secondary_xaction = $this->getObject($xaction_phid); | |||||
$old_target = $secondary_xaction->getRenderingTarget(); | |||||
$secondary_xaction->setRenderingTarget($new_target); | |||||
$secondary_xaction->setHandles($this->getHandles()); | |||||
$body = $secondary_xaction->getBodyForMail(); | |||||
if (nonempty($body)) { | |||||
$all_bodies .= $body."\n"; | |||||
} | |||||
$secondary_xaction->setRenderingTarget($old_target); | |||||
} | |||||
return trim($all_bodies); | |||||
} | |||||
public function getImageURI() { | |||||
$author_phid = $this->getPrimaryTransaction()->getAuthorPHID(); | |||||
return $this->getHandle($author_phid)->getImageURI(); | |||||
} | |||||
public function getURI() { | |||||
$handle = $this->getHandle($this->getPrimaryObjectPHID()); | |||||
return PhabricatorEnv::getProductionURI($handle->getURI()); | |||||
} | |||||
public function renderAsTextForDoorkeeper( | public function renderAsTextForDoorkeeper( | ||||
DoorkeeperFeedStoryPublisher $publisher) { | DoorkeeperFeedStoryPublisher $publisher) { | ||||
$xactions = array(); | $xactions = array(); | ||||
$xaction_phids = $this->getValue('transactionPHIDs'); | $xaction_phids = $this->getValue('transactionPHIDs'); | ||||
foreach ($xaction_phids as $xaction_phid) { | foreach ($xaction_phids as $xaction_phid) { | ||||
$xaction = $this->getObject($xaction_phid); | $xaction = $this->getObject($xaction_phid); | ||||
$xaction->setHandles($this->getHandles()); | $xaction->setHandles($this->getHandles()); | ||||
$xactions[] = $xaction; | $xactions[] = $xaction; | ||||
} | } | ||||
$primary = $this->getPrimaryTransaction(); | $primary = $this->getPrimaryTransaction(); | ||||
return $primary->renderAsTextForDoorkeeper($publisher, $this, $xactions); | return $primary->renderAsTextForDoorkeeper($publisher, $this, $xactions); | ||||
} | } | ||||
} | } |