Page MenuHomePhabricator

D14914.id36039.diff
No OneTemporary

D14914.id36039.diff

diff --git a/src/applications/phame/storage/PhamePostTransaction.php b/src/applications/phame/storage/PhamePostTransaction.php
--- a/src/applications/phame/storage/PhamePostTransaction.php
+++ b/src/applications/phame/storage/PhamePostTransaction.php
@@ -4,7 +4,6 @@
extends PhabricatorApplicationTransaction {
const TYPE_TITLE = 'phame.post.title';
- const TYPE_PHAME_TITLE = 'phame.post.phame.title';
const TYPE_BODY = 'phame.post.body';
const TYPE_VISIBILITY = 'phame.post.visibility';
const TYPE_BLOG = 'phame.post.blog';
@@ -39,12 +38,6 @@
}
public function shouldHide() {
- $old = $this->getOldValue();
- switch ($this->getTransactionType()) {
- case self::TYPE_PHAME_TITLE:
- case self::TYPE_BODY:
- return ($old === null);
- }
return parent::shouldHide();
}
@@ -72,19 +65,18 @@
public function getIcon() {
$old = $this->getOldValue();
+ $new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case self::TYPE_TITLE:
- if ($old === null) {
- return 'fa-plus';
+ case PhabricatorTransactions::TYPE_CREATE:
+ return 'fa-plus';
+ break;
+ case self::TYPE_VISIBILITY:
+ if ($new == PhameConstants::VISIBILITY_PUBLISHED) {
+ return 'fa-globe';
} else {
- return 'fa-pencil';
+ return 'fa-eye-slash';
}
- break;
- case self::TYPE_PHAME_TITLE:
- case self::TYPE_BODY:
- case self::TYPE_VISIBILITY:
- return 'fa-pencil';
- break;
+ break;
}
return parent::getIcon();
}
@@ -100,7 +92,6 @@
$tags[] = self::MAILTAG_SUBSCRIBERS;
break;
case self::TYPE_TITLE:
- case self::TYPE_PHAME_TITLE:
case self::TYPE_BODY:
$tags[] = self::MAILTAG_CONTENT;
break;
@@ -123,7 +114,7 @@
switch ($type) {
case PhabricatorTransactions::TYPE_CREATE:
return pht(
- '%s created this post.',
+ '%s authored this post.',
$this->renderHandleLink($author_phid));
case self::TYPE_BLOG:
return pht(
@@ -159,12 +150,6 @@
$this->renderHandleLink($author_phid));
}
break;
- case self::TYPE_PHAME_TITLE:
- return pht(
- '%s updated the post\'s Phame title to "%s".',
- $this->renderHandleLink($author_phid),
- rtrim($new, '/'));
- break;
}
return parent::getTitle();
@@ -179,6 +164,11 @@
$type = $this->getTransactionType();
switch ($type) {
+ case PhabricatorTransactions::TYPE_CREATE:
+ return pht(
+ '%s authored %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid));
case self::TYPE_BLOG:
return pht(
'%s moved post "%s" from "%s" to "%s".',
@@ -218,37 +208,30 @@
$this->renderHandleLink($object_phid));
}
break;
- case self::TYPE_PHAME_TITLE:
- return pht(
- '%s updated the Phame title for %s.',
- $this->renderHandleLink($author_phid),
- $this->renderHandleLink($object_phid));
- break;
}
return parent::getTitleForFeed();
}
public function getRemarkupBodyForFeed(PhabricatorFeedStory $story) {
+ $old = $this->getOldValue();
+
switch ($this->getTransactionType()) {
case self::TYPE_BODY:
- return $this->getNewValue();
+ if ($old === null) {
+ return $this->getNewValue();
+ }
+ break;
}
return null;
}
public function getColor() {
- $old = $this->getOldValue();
-
switch ($this->getTransactionType()) {
- case self::TYPE_TITLE:
- if ($old === null) {
- return PhabricatorTransactions::COLOR_GREEN;
- }
- break;
+ case PhabricatorTransactions::TYPE_CREATE:
+ return PhabricatorTransactions::COLOR_GREEN;
}
-
return parent::getColor();
}

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 30, 8:03 PM (6 d, 16 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225097
Default Alt Text
D14914.id36039.diff (3 KB)

Event Timeline