1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 09:12:41 +01:00

Add comment snippets to feed stories

Summary: Fixes T3622

Test Plan: viewed feed, saw some commentary for both pholio inlines and pholio regular comments

Reviewers: epriestley

Reviewed By: epriestley

CC: chad, aran, Korvin

Maniphest Tasks: T3622

Differential Revision: https://secure.phabricator.com/D6570
This commit is contained in:
Bob Trahan 2013-07-25 16:59:36 -07:00
parent f75f3a0c3b
commit f666538702
3 changed files with 28 additions and 0 deletions

View file

@ -233,6 +233,17 @@ final class PholioTransaction extends PhabricatorApplicationTransaction {
return parent::getTitleForFeed(); return parent::getTitleForFeed();
} }
public function getBodyForFeed() {
switch ($this->getTransactionType()) {
case PholioTransactionType::TYPE_INLINE:
$text = $this->getComment()->getContent();
return phutil_escape_html_newlines(
phutil_utf8_shorten($text, 128));
break;
}
return parent::getBodyForFeed();
}
public function hasChangeDetails() { public function hasChangeDetails() {
switch ($this->getTransactionType()) { switch ($this->getTransactionType()) {
case PholioTransactionType::TYPE_DESCRIPTION: case PholioTransactionType::TYPE_DESCRIPTION:

View file

@ -44,6 +44,7 @@ class PhabricatorApplicationTransactionFeedStory
$xaction->setHandles($this->getHandles()); $xaction->setHandles($this->getHandles());
$view->setTitle($xaction->getTitleForFeed()); $view->setTitle($xaction->getTitleForFeed());
$view->appendChild($xaction->getBodyForFeed());
$view->setImage( $view->setImage(
$this->getHandle( $this->getHandle(

View file

@ -379,6 +379,22 @@ abstract class PhabricatorApplicationTransaction
return $this->getTitle(); return $this->getTitle();
} }
public function getBodyForFeed() {
$old = $this->getOldValue();
$new = $this->getNewValue();
$body = null;
switch ($this->getTransactionType()) {
case PhabricatorTransactions::TYPE_COMMENT:
$text = $this->getComment()->getContent();
$body = phutil_escape_html_newlines(
phutil_utf8_shorten($text, 128));
break;
}
return $body;
}
public function getActionStrength() { public function getActionStrength() {
switch ($this->getTransactionType()) { switch ($this->getTransactionType()) {
case PhabricatorTransactions::TYPE_COMMENT: case PhabricatorTransactions::TYPE_COMMENT: