Page MenuHomePhabricator

D16561.diff
No OneTemporary

D16561.diff

diff --git a/src/applications/conpherence/controller/ConpherenceNewRoomController.php b/src/applications/conpherence/controller/ConpherenceNewRoomController.php
--- a/src/applications/conpherence/controller/ConpherenceNewRoomController.php
+++ b/src/applications/conpherence/controller/ConpherenceNewRoomController.php
@@ -16,16 +16,16 @@
$editor = new ConpherenceEditor();
$xactions = array();
+ $xactions[] = id(new ConpherenceTransaction())
+ ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
+ ->setNewValue($request->getStr('title'));
+
$participants = $request->getArr('participants');
$participants[] = $user->getPHID();
$participants = array_unique($participants);
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('+' => $participants));
-
- $xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
- ->setNewValue($request->getStr('title'));
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(ConpherenceTransaction::TYPE_TOPIC)
->setNewValue($request->getStr('topic'));
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,17 @@
protected function shouldPublishFeedStory(
PhabricatorLiskDAO $object,
array $xactions) {
+
+ foreach ($xactions as $xaction) {
+ switch ($xaction->getTransactionType()) {
+ case ConpherenceTransaction::TYPE_TITLE:
+ case ConpherenceTransaction::TYPE_TOPIC:
+ case ConpherenceTransaction::TYPE_PICTURE:
+ return true;
+ default:
+ return false;
+ }
+ }
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,55 @@
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 (strlen($old) && strlen($new)) {
+ return pht(
+ '%s renamed %s from "%s" to "%s".',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid),
+ $old,
+ $new);
+ } else {
+ return pht(
+ '%s created the room %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid));
+ }
+ break;
+ break;
+ case self::TYPE_TOPIC:
+ if (strlen($new)) {
+ return pht(
+ '%s set the topic of %s to "%s".',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid),
+ $new);
+ } else if (strlen($old)) {
+ return pht(
+ '%s deleted the topic in %s',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid));
+ }
+ break;
+ case self::TYPE_PICTURE:
+ return pht(
+ '%s updated the room image for %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
Mon, Mar 24, 12:17 PM (1 w, 20 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7404121
Default Alt Text
D16561.diff (3 KB)

Event Timeline