Page MenuHomePhabricator

D14648.diff
No OneTemporary

D14648.diff

diff --git a/src/applications/ponder/storage/PonderAnswerTransaction.php b/src/applications/ponder/storage/PonderAnswerTransaction.php
--- a/src/applications/ponder/storage/PonderAnswerTransaction.php
+++ b/src/applications/ponder/storage/PonderAnswerTransaction.php
@@ -38,13 +38,11 @@
public function getRemarkupBlocks() {
$blocks = parent::getRemarkupBlocks();
-
switch ($this->getTransactionType()) {
case self::TYPE_CONTENT:
$blocks[] = $this->getNewValue();
break;
}
-
return $blocks;
}
@@ -134,20 +132,14 @@
return parent::getTitleForFeed();
}
- public function getBodyForFeed(PhabricatorFeedStory $story) {
- $new = $this->getNewValue();
-
- $body = null;
-
+ public function getRemarkupBodyForFeed(PhabricatorFeedStory $story) {
+ $text = null;
switch ($this->getTransactionType()) {
case self::TYPE_CONTENT:
- return phutil_escape_html_newlines(
- id(new PhutilUTF8StringTruncator())
- ->setMaximumGlyphs(128)
- ->truncateString($new));
+ $text = $this->getNewValue();
break;
}
- return parent::getBodyForFeed($story);
+ return $text;
}
diff --git a/src/applications/ponder/storage/PonderQuestionTransaction.php b/src/applications/ponder/storage/PonderQuestionTransaction.php
--- a/src/applications/ponder/storage/PonderQuestionTransaction.php
+++ b/src/applications/ponder/storage/PonderQuestionTransaction.php
@@ -45,13 +45,11 @@
public function getRemarkupBlocks() {
$blocks = parent::getRemarkupBlocks();
-
switch ($this->getTransactionType()) {
case self::TYPE_CONTENT:
$blocks[] = $this->getNewValue();
break;
}
-
return $blocks;
}
@@ -222,20 +220,6 @@
return parent::getActionName();
}
- public function shouldHide() {
- switch ($this->getTransactionType()) {
- case self::TYPE_CONTENT:
- if ($this->getOldValue() === null) {
- return true;
- } else {
- return false;
- }
- break;
- }
-
- return parent::shouldHide();
- }
-
public function getTitleForFeed() {
$author_phid = $this->getAuthorPHID();
$object_phid = $this->getObjectPHID();
@@ -302,34 +286,14 @@
return parent::getTitleForFeed();
}
- public function getBodyForFeed(PhabricatorFeedStory $story) {
- $new = $this->getNewValue();
- $old = $this->getOldValue();
-
- $body = null;
-
+ public function getRemarkupBodyForFeed(PhabricatorFeedStory $story) {
+ $text = null;
switch ($this->getTransactionType()) {
- case self::TYPE_TITLE:
- if ($old === null) {
- $question = $story->getObject($this->getObjectPHID());
- return phutil_escape_html_newlines(
- id(new PhutilUTF8StringTruncator())
- ->setMaximumGlyphs(128)
- ->truncateString($question->getContent()));
- }
- break;
- case self::TYPE_ANSWERS:
- $answer = $this->getNewAnswerObject($story);
- if ($answer) {
- return phutil_escape_html_newlines(
- id(new PhutilUTF8StringTruncator())
- ->setMaximumGlyphs(128)
- ->truncateString($answer->getContent()));
- }
+ case self::TYPE_CONTENT:
+ $text = $this->getNewValue();
break;
}
-
- return parent::getBodyForFeed($story);
+ return $text;
}
/**

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 27, 12:54 PM (1 w, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7707253
Default Alt Text
D14648.diff (3 KB)

Event Timeline