Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php b/src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php
index f9d24a0a93..931a78df96 100644
--- a/src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php
+++ b/src/applications/paste/xaction/PhabricatorPasteTitleTransaction.php
@@ -1,33 +1,65 @@
<?php
final class PhabricatorPasteTitleTransaction
extends PhabricatorPasteTransactionType {
const TRANSACTIONTYPE = 'paste.title';
public function generateOldValue($object) {
return $object->getTitle();
}
public function applyInternalEffects($object, $value) {
$object->setTitle($value);
}
public function getTitle() {
- return pht(
- '%s changed the title of this paste from %s to %s.',
- $this->renderAuthor(),
- $this->renderOldValue(),
- $this->renderNewValue());
+ $old = $this->getOldValue();
+ $new = $this->getNeWValue();
+
+ if (strlen($old) && strlen($new)) {
+ return pht(
+ '%s changed the title of this paste from %s to %s.',
+ $this->renderAuthor(),
+ $this->renderOldValue(),
+ $this->renderNewValue());
+ } else if (strlen($new)) {
+ return pht(
+ '%s changed the title of this paste from untitled to %s.',
+ $this->renderAuthor(),
+ $this->renderNewValue());
+ } else {
+ return pht(
+ '%s changed the title of this paste from %s to untitled.',
+ $this->renderAuthor(),
+ $this->renderOldValue());
+ }
}
public function getTitleForFeed() {
- return pht(
- '%s updated the title for %s from %s to %s.',
- $this->renderAuthor(),
- $this->renderObject(),
- $this->renderOldValue(),
- $this->renderNewValue());
+ $old = $this->getOldValue();
+ $new = $this->getNeWValue();
+
+ if (strlen($old) && strlen($new)) {
+ return pht(
+ '%s updated the title for %s from %s to %s.',
+ $this->renderAuthor(),
+ $this->renderObject(),
+ $this->renderOldValue(),
+ $this->renderNewValue());
+ } else if (strlen($new)) {
+ return pht(
+ '%s updated the title for %s from untitled to %s.',
+ $this->renderAuthor(),
+ $this->renderObject(),
+ $this->renderNewValue());
+ } else {
+ return pht(
+ '%s updated the title for %s from %s to untitled.',
+ $this->renderAuthor(),
+ $this->renderObject(),
+ $this->renderOldValue());
+ }
}
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jun 10, 9:20 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
141059
Default Alt Text
(2 KB)

Event Timeline