Page MenuHomePhabricator

D16561.id39858.diff
No OneTemporary

D16561.id39858.diff

diff --git a/src/applications/conpherence/editor/ConpherenceEditor.php b/src/applications/conpherence/editor/ConpherenceEditor.php
--- a/src/applications/conpherence/editor/ConpherenceEditor.php
+++ b/src/applications/conpherence/editor/ConpherenceEditor.php
@@ -623,6 +623,19 @@
protected function shouldPublishFeedStory(
PhabricatorLiskDAO $object,
array $xactions) {
+
+ foreach ($xactions as $xaction) {
+ switch ($xaction->getTransactionType()) {
+ case ConpherenceTransaction::TYPE_TITLE:
+ if ($xaction->getOldValue() == '') {
+ return true;
+ }
+ return false;
+ break;
+ case ConpherenceTransaction::TYPE_TOPIC:
+ return true;
+ }
+ }
return false;
}
diff --git a/src/applications/conpherence/storage/ConpherenceTransaction.php b/src/applications/conpherence/storage/ConpherenceTransaction.php
--- a/src/applications/conpherence/storage/ConpherenceTransaction.php
+++ b/src/applications/conpherence/storage/ConpherenceTransaction.php
@@ -123,6 +123,50 @@
return parent::getTitle();
}
+ public function getTitleForFeed() {
+ $author_phid = $this->getAuthorPHID();
+ $object_phid = $this->getObjectPHID();
+
+ $old = $this->getOldValue();
+ $new = $this->getNewValue();
+
+ $type = $this->getTransactionType();
+ switch ($type) {
+ case self::TYPE_TITLE:
+ if ($old == '') {
+ return pht(
+ '%s created %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid));
+
+ } else {
+ return pht(
+ '%s renamed %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid));
+ }
+ break;
+ case self::TYPE_TOPIC:
+ if ($new) {
+ $title = pht(
+ '%s set the topic of %s to "%s".',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid),
+ $new);
+ } else if ($old) {
+ $title = pht(
+ '%s deleted the topic in "%s"',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid));
+ }
+ break;
+ }
+
+ return parent::getTitleForFeed();
+ }
+
+
+
private function getRoomTitle() {
$author_phid = $this->getAuthorPHID();

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 15, 7:52 PM (2 w, 9 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7702874
Default Alt Text
D16561.id39858.diff (2 KB)

Event Timeline