Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15337375
D16561.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D16561.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 10, 5:34 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7404121
Default Alt Text
D16561.diff (3 KB)
Attached To
Mode
D16561: Add basic feed stories for Conpherence
Attached
Detach File
Event Timeline
Log In to Comment