Changeset View
Changeset View
Standalone View
Standalone View
src/applications/ponder/storage/PonderQuestionTransaction.php
| Show First 20 Lines • Show All 246 Lines • ▼ Show 20 Lines | public function getBodyForFeed(PhabricatorFeedStory $story) { | ||||
| $body = null; | $body = null; | ||||
| switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
| case self::TYPE_TITLE: | case self::TYPE_TITLE: | ||||
| if ($old === null) { | if ($old === null) { | ||||
| $question = $story->getObject($this->getObjectPHID()); | $question = $story->getObject($this->getObjectPHID()); | ||||
| return phutil_escape_html_newlines( | return phutil_escape_html_newlines( | ||||
| phutil_utf8_shorten($question->getContent(), 128)); | id(new PhutilUTF8StringTruncator()) | ||||
| ->setMaximumGlyphs(128) | |||||
| ->truncateString($question->getContent())); | |||||
| } | } | ||||
| break; | break; | ||||
| case self::TYPE_ANSWERS: | case self::TYPE_ANSWERS: | ||||
| $answer = $this->getNewAnswerObject($story); | $answer = $this->getNewAnswerObject($story); | ||||
| if ($answer) { | if ($answer) { | ||||
| return phutil_escape_html_newlines( | return phutil_escape_html_newlines( | ||||
| phutil_utf8_shorten($answer->getContent(), 128)); | id(new PhutilUTF8StringTruncator()) | ||||
| ->setMaximumGlyphs(128) | |||||
| ->truncateString($answer->getContent())); | |||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| return parent::getBodyForFeed($story); | return parent::getBodyForFeed($story); | ||||
| } | } | ||||
| /** | /** | ||||
| Show All 37 Lines | |||||