1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 18:52:42 +01:00

Fix double feed stories in Phame

Summary:
Ref T9360. Fixes the double-rendering of post bodies in feed stories.

Downside is that 'publish' (on its own) no longer shows a body, but that seems fine.

Test Plan:
  - Got some double bodies.
  - Applied patch.
  - No more double bodies.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9360

Differential Revision: https://secure.phabricator.com/D14748
This commit is contained in:
epriestley 2015-12-11 18:45:09 -08:00
parent 4b77bbd60c
commit 3d14b76f4d

View file

@ -190,26 +190,12 @@ final class PhamePostTransaction
} }
public function getRemarkupBodyForFeed(PhabricatorFeedStory $story) { public function getRemarkupBodyForFeed(PhabricatorFeedStory $story) {
$text = null;
switch ($this->getTransactionType()) { switch ($this->getTransactionType()) {
case self::TYPE_TITLE:
if ($this->getOldValue() === null) {
$post = $story->getPrimaryObject();
$text = $post->getBody();
}
break;
case self::TYPE_VISIBILITY:
if ($this->getNewValue() == PhameConstants::VISIBILITY_PUBLISHED) {
$post = $story->getPrimaryObject();
$text = $post->getBody();
}
break;
case self::TYPE_BODY: case self::TYPE_BODY:
$text = $this->getNewValue(); return $this->getNewValue();
break;
} }
return $text; return null;
} }
public function getColor() { public function getColor() {