@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update Ponder for Remarkup in Feed

Summary: Update Ponder Questions and Answers to render Remarkup in Feed

Test Plan: New Question, Edit Question, New Answer, Edit Answer, New Comment. See //remarkup// in Feed.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9825

Differential Revision: https://secure.phabricator.com/D14648

+9 -53
+4 -12
src/applications/ponder/storage/PonderAnswerTransaction.php
··· 38 38 39 39 public function getRemarkupBlocks() { 40 40 $blocks = parent::getRemarkupBlocks(); 41 - 42 41 switch ($this->getTransactionType()) { 43 42 case self::TYPE_CONTENT: 44 43 $blocks[] = $this->getNewValue(); 45 44 break; 46 45 } 47 - 48 46 return $blocks; 49 47 } 50 48 ··· 134 132 return parent::getTitleForFeed(); 135 133 } 136 134 137 - public function getBodyForFeed(PhabricatorFeedStory $story) { 138 - $new = $this->getNewValue(); 139 - 140 - $body = null; 141 - 135 + public function getRemarkupBodyForFeed(PhabricatorFeedStory $story) { 136 + $text = null; 142 137 switch ($this->getTransactionType()) { 143 138 case self::TYPE_CONTENT: 144 - return phutil_escape_html_newlines( 145 - id(new PhutilUTF8StringTruncator()) 146 - ->setMaximumGlyphs(128) 147 - ->truncateString($new)); 139 + $text = $this->getNewValue(); 148 140 break; 149 141 } 150 - return parent::getBodyForFeed($story); 142 + return $text; 151 143 } 152 144 153 145
+5 -41
src/applications/ponder/storage/PonderQuestionTransaction.php
··· 45 45 46 46 public function getRemarkupBlocks() { 47 47 $blocks = parent::getRemarkupBlocks(); 48 - 49 48 switch ($this->getTransactionType()) { 50 49 case self::TYPE_CONTENT: 51 50 $blocks[] = $this->getNewValue(); 52 51 break; 53 52 } 54 - 55 53 return $blocks; 56 54 } 57 55 ··· 222 220 return parent::getActionName(); 223 221 } 224 222 225 - public function shouldHide() { 226 - switch ($this->getTransactionType()) { 227 - case self::TYPE_CONTENT: 228 - if ($this->getOldValue() === null) { 229 - return true; 230 - } else { 231 - return false; 232 - } 233 - break; 234 - } 235 - 236 - return parent::shouldHide(); 237 - } 238 - 239 223 public function getTitleForFeed() { 240 224 $author_phid = $this->getAuthorPHID(); 241 225 $object_phid = $this->getObjectPHID(); ··· 302 286 return parent::getTitleForFeed(); 303 287 } 304 288 305 - public function getBodyForFeed(PhabricatorFeedStory $story) { 306 - $new = $this->getNewValue(); 307 - $old = $this->getOldValue(); 308 - 309 - $body = null; 310 - 289 + public function getRemarkupBodyForFeed(PhabricatorFeedStory $story) { 290 + $text = null; 311 291 switch ($this->getTransactionType()) { 312 - case self::TYPE_TITLE: 313 - if ($old === null) { 314 - $question = $story->getObject($this->getObjectPHID()); 315 - return phutil_escape_html_newlines( 316 - id(new PhutilUTF8StringTruncator()) 317 - ->setMaximumGlyphs(128) 318 - ->truncateString($question->getContent())); 319 - } 320 - break; 321 - case self::TYPE_ANSWERS: 322 - $answer = $this->getNewAnswerObject($story); 323 - if ($answer) { 324 - return phutil_escape_html_newlines( 325 - id(new PhutilUTF8StringTruncator()) 326 - ->setMaximumGlyphs(128) 327 - ->truncateString($answer->getContent())); 328 - } 292 + case self::TYPE_CONTENT: 293 + $text = $this->getNewValue(); 329 294 break; 330 295 } 331 - 332 - return parent::getBodyForFeed($story); 296 + return $text; 333 297 } 334 298 335 299 /**