Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14722407
D17668.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
28 KB
Referenced Files
None
Subscribers
None
D17668.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -9,7 +9,7 @@
'names' => array(
'conpherence.pkg.css' => 'b5ee2073',
'conpherence.pkg.js' => '281b1a73',
- 'core.pkg.css' => '476a4ec7',
+ 'core.pkg.css' => '30a64ed6',
'core.pkg.js' => 'fbc1c380',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '90b30783',
@@ -167,7 +167,7 @@
'rsrc/css/phui/phui-spacing.css' => '042804d6',
'rsrc/css/phui/phui-status.css' => 'd5263e49',
'rsrc/css/phui/phui-tag-view.css' => '84d65f26',
- 'rsrc/css/phui/phui-timeline-view.css' => 'bf45789e',
+ 'rsrc/css/phui/phui-timeline-view.css' => '1d7ef61d',
'rsrc/css/phui/phui-two-column-view.css' => 'ce9fa0b7',
'rsrc/css/phui/workboards/phui-workboard-color.css' => '783cdff5',
'rsrc/css/phui/workboards/phui-workboard.css' => '3bc85455',
@@ -877,7 +877,7 @@
'phui-status-list-view-css' => 'd5263e49',
'phui-tag-view-css' => '84d65f26',
'phui-theme-css' => '9f261c6b',
- 'phui-timeline-view-css' => 'bf45789e',
+ 'phui-timeline-view-css' => '1d7ef61d',
'phui-two-column-view-css' => 'ce9fa0b7',
'phui-workboard-color-css' => '783cdff5',
'phui-workboard-view-css' => '3bc85455',
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -320,11 +320,15 @@
'ConpherenceThreadListView' => 'applications/conpherence/view/ConpherenceThreadListView.php',
'ConpherenceThreadMailReceiver' => 'applications/conpherence/mail/ConpherenceThreadMailReceiver.php',
'ConpherenceThreadMembersPolicyRule' => 'applications/conpherence/policyrule/ConpherenceThreadMembersPolicyRule.php',
+ 'ConpherenceThreadPictureTransaction' => 'applications/conpherence/xaction/ConpherenceThreadPictureTransaction.php',
'ConpherenceThreadQuery' => 'applications/conpherence/query/ConpherenceThreadQuery.php',
'ConpherenceThreadRemarkupRule' => 'applications/conpherence/remarkup/ConpherenceThreadRemarkupRule.php',
'ConpherenceThreadSearchController' => 'applications/conpherence/controller/ConpherenceThreadSearchController.php',
'ConpherenceThreadSearchEngine' => 'applications/conpherence/query/ConpherenceThreadSearchEngine.php',
'ConpherenceThreadTitleNgrams' => 'applications/conpherence/storage/ConpherenceThreadTitleNgrams.php',
+ 'ConpherenceThreadTitleTransaction' => 'applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php',
+ 'ConpherenceThreadTopicTransaction' => 'applications/conpherence/xaction/ConpherenceThreadTopicTransaction.php',
+ 'ConpherenceThreadTransactionType' => 'applications/conpherence/xaction/ConpherenceThreadTransactionType.php',
'ConpherenceTransaction' => 'applications/conpherence/storage/ConpherenceTransaction.php',
'ConpherenceTransactionComment' => 'applications/conpherence/storage/ConpherenceTransactionComment.php',
'ConpherenceTransactionQuery' => 'applications/conpherence/query/ConpherenceTransactionQuery.php',
@@ -5099,12 +5103,16 @@
'ConpherenceThreadListView' => 'AphrontView',
'ConpherenceThreadMailReceiver' => 'PhabricatorObjectMailReceiver',
'ConpherenceThreadMembersPolicyRule' => 'PhabricatorPolicyRule',
+ 'ConpherenceThreadPictureTransaction' => 'ConpherenceThreadTransactionType',
'ConpherenceThreadQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'ConpherenceThreadRemarkupRule' => 'PhabricatorObjectRemarkupRule',
'ConpherenceThreadSearchController' => 'ConpherenceController',
'ConpherenceThreadSearchEngine' => 'PhabricatorApplicationSearchEngine',
'ConpherenceThreadTitleNgrams' => 'PhabricatorSearchNgrams',
- 'ConpherenceTransaction' => 'PhabricatorApplicationTransaction',
+ 'ConpherenceThreadTitleTransaction' => 'ConpherenceThreadTransactionType',
+ 'ConpherenceThreadTopicTransaction' => 'ConpherenceThreadTransactionType',
+ 'ConpherenceThreadTransactionType' => 'PhabricatorModularTransactionType',
+ 'ConpherenceTransaction' => 'PhabricatorModularTransaction',
'ConpherenceTransactionComment' => 'PhabricatorApplicationTransactionComment',
'ConpherenceTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'ConpherenceTransactionRenderer' => 'Phobject',
diff --git a/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php b/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php
--- a/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php
+++ b/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php
@@ -123,7 +123,8 @@
->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('+' => $participant_phids));
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
+ ->setTransactionType(
+ ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)
->setNewValue(pht('Test'));
id(new ConpherenceEditor())
diff --git a/src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php b/src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php
--- a/src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php
+++ b/src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php
@@ -83,7 +83,8 @@
}
if ($title) {
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
+ ->setTransactionType(
+ ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)
->setNewValue($title);
}
if ($message) {
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,7 +16,7 @@
$xactions = array();
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
+ ->setTransactionType(ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)
->setNewValue($request->getStr('title'));
$participants = $request->getArr('participants');
@@ -26,7 +26,7 @@
->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('+' => $participants));
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_TOPIC)
+ ->setTransactionType(ConpherenceThreadTopicTransaction::TRANSACTIONTYPE)
->setNewValue($request->getStr('topic'));
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
@@ -50,7 +50,8 @@
} catch (PhabricatorApplicationTransactionValidationException $ex) {
$validation_exception = $ex;
- $e_title = $ex->getShortMessage(ConpherenceTransaction::TYPE_TITLE);
+ $e_title = $ex->getShortMessage(
+ ConpherenceThreadTitleTransaction::TRANSACTIONTYPE);
$conpherence->setViewPolicy($request->getStr('viewPolicy'));
$conpherence->setEditPolicy($request->getStr('editPolicy'));
diff --git a/src/applications/conpherence/controller/ConpherenceRoomPictureController.php b/src/applications/conpherence/controller/ConpherenceRoomPictureController.php
--- a/src/applications/conpherence/controller/ConpherenceRoomPictureController.php
+++ b/src/applications/conpherence/controller/ConpherenceRoomPictureController.php
@@ -76,7 +76,8 @@
$xactions = array();
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_PICTURE)
+ ->setTransactionType(
+ ConpherenceThreadPictureTransaction::TRANSACTIONTYPE)
->setNewValue($new_value);
$editor = id(new ConpherenceEditor())
diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php
--- a/src/applications/conpherence/controller/ConpherenceUpdateController.php
+++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php
@@ -140,10 +140,12 @@
$title = $request->getStr('title');
$topic = $request->getStr('topic');
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
+ ->setTransactionType(
+ ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)
->setNewValue($title);
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_TOPIC)
+ ->setTransactionType(
+ ConpherenceThreadTopicTransaction::TRANSACTIONTYPE)
->setNewValue($topic);
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
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
@@ -41,12 +41,14 @@
->setNewValue(array('+' => $participant_phids));
if ($title) {
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
+ ->setTransactionType(
+ ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)
->setNewValue($title);
}
if (strlen($topic)) {
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_TOPIC)
+ ->setTransactionType(
+ ConpherenceThreadTopicTransaction::TRANSACTIONTYPE)
->setNewValue($topic);
}
@@ -87,10 +89,7 @@
$types[] = PhabricatorTransactions::TYPE_COMMENT;
- $types[] = ConpherenceTransaction::TYPE_TITLE;
- $types[] = ConpherenceTransaction::TYPE_TOPIC;
$types[] = ConpherenceTransaction::TYPE_PARTICIPANTS;
- $types[] = ConpherenceTransaction::TYPE_PICTURE;
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
$types[] = PhabricatorTransactions::TYPE_JOIN_POLICY;
@@ -98,17 +97,34 @@
return $types;
}
+ public function getCreateObjectTitle($author, $object) {
+ return pht('%s created this room.', $author);
+ }
+
+ protected function shouldPublishFeedStory(
+ PhabricatorLiskDAO $object,
+ array $xactions) {
+
+ foreach ($xactions as $xaction) {
+ switch ($xaction->getTransactionType()) {
+ case ConpherenceThreadTitleTransaction::TRANSACTIONTYPE:
+ case ConpherenceThreadTopicTransaction::TRANSACTIONTYPE:
+ case ConpherenceThreadPictureTransaction::TRANSACTIONTYPE:
+ return true;
+ default:
+ return false;
+ }
+ }
+ return true;
+ }
+
+
+
protected function getCustomTransactionOldValue(
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case ConpherenceTransaction::TYPE_TITLE:
- return $object->getTitle();
- case ConpherenceTransaction::TYPE_TOPIC:
- return $object->getTopic();
- case ConpherenceTransaction::TYPE_PICTURE:
- return $object->getProfileImagePHID();
case ConpherenceTransaction::TYPE_PARTICIPANTS:
if ($this->getIsNewObject()) {
return array();
@@ -122,10 +138,6 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case ConpherenceTransaction::TYPE_TITLE:
- case ConpherenceTransaction::TYPE_TOPIC:
- case ConpherenceTransaction::TYPE_PICTURE:
- return $xaction->getNewValue();
case ConpherenceTransaction::TYPE_PARTICIPANTS:
return $this->getPHIDTransactionNewValue($xaction);
}
@@ -211,15 +223,6 @@
$make_author_recent_participant = true;
switch ($xaction->getTransactionType()) {
- case ConpherenceTransaction::TYPE_TITLE:
- $object->setTitle($xaction->getNewValue());
- break;
- case ConpherenceTransaction::TYPE_TOPIC:
- $object->setTopic($xaction->getNewValue());
- break;
- case ConpherenceTransaction::TYPE_PICTURE:
- $object->setProfileImagePHID($xaction->getNewValue());
- break;
case ConpherenceTransaction::TYPE_PARTICIPANTS:
if (!$this->getIsNewObject()) {
$old_map = array_fuse($xaction->getOldValue());
@@ -418,8 +421,8 @@
PhabricatorPolicyCapability::CAN_EDIT);
}
break;
- case ConpherenceTransaction::TYPE_TITLE:
- case ConpherenceTransaction::TYPE_TOPIC:
+ case ConpherenceThreadTitleTransaction::TRANSACTIONTYPE:
+ case ConpherenceThreadTopicTransaction::TRANSACTIONTYPE:
PhabricatorPolicyFilter::requireCapability(
$this->requireActor(),
$object,
@@ -434,8 +437,6 @@
$type = $u->getTransactionType();
switch ($type) {
- case ConpherenceTransaction::TYPE_TITLE:
- return $v;
case ConpherenceTransaction::TYPE_PARTICIPANTS:
return $this->mergePHIDOrEdgeTransactions($u, $v);
}
@@ -541,23 +542,6 @@
return PhabricatorEnv::getEnvConfig('metamta.conpherence.subject-prefix');
}
- 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;
- }
-
protected function supportsSearch() {
return true;
}
@@ -570,26 +554,6 @@
$errors = parent::validateTransaction($object, $type, $xactions);
switch ($type) {
- case ConpherenceTransaction::TYPE_TITLE:
- if (empty($xactions)) {
- break;
- }
- $missing = $this->validateIsEmptyTextField(
- $object->getTitle(),
- $xactions);
-
- if ($missing) {
- $detail = pht('Room title is required.');
- $error = new PhabricatorApplicationTransactionValidationError(
- $type,
- pht('Required'),
- $detail,
- last($xactions));
-
- $error->setIsMissingFieldError(true);
- $errors[] = $error;
- }
- break;
case ConpherenceTransaction::TYPE_PARTICIPANTS:
foreach ($xactions as $xaction) {
$new_phids = $this->getPHIDTransactionNewValue($xaction, array());
diff --git a/src/applications/conpherence/storage/ConpherenceThread.php b/src/applications/conpherence/storage/ConpherenceThread.php
--- a/src/applications/conpherence/storage/ConpherenceThread.php
+++ b/src/applications/conpherence/storage/ConpherenceThread.php
@@ -268,9 +268,9 @@
case PhabricatorTransactions::TYPE_COMMENT:
$message_transaction = $transaction;
break;
- case ConpherenceTransaction::TYPE_TITLE:
- case ConpherenceTransaction::TYPE_TOPIC:
- case ConpherenceTransaction::TYPE_PICTURE:
+ case ConpherenceThreadTitleTransaction::TRANSACTIONTYPE:
+ case ConpherenceThreadTopicTransaction::TRANSACTIONTYPE:
+ case ConpherenceThreadPictureTransaction::TRANSACTIONTYPE:
case ConpherenceTransaction::TYPE_PARTICIPANTS:
$action_transaction = $transaction;
break;
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
@@ -1,12 +1,10 @@
<?php
-final class ConpherenceTransaction extends PhabricatorApplicationTransaction {
+final class ConpherenceTransaction
+ extends PhabricatorModularTransaction {
- const TYPE_TITLE = 'title';
- const TYPE_TOPIC = 'topic';
const TYPE_PARTICIPANTS = 'participants';
const TYPE_DATE_MARKER = 'date-marker';
- const TYPE_PICTURE = 'picture';
public function getApplicationName() {
return 'conpherence';
@@ -20,6 +18,10 @@
return new ConpherenceTransactionComment();
}
+ public function getBaseTransactionClass() {
+ return 'ConpherenceThreadTransactionType';
+ }
+
public function getNoEffectDescription() {
switch ($this->getTransactionType()) {
case self::TYPE_PARTICIPANTS:
@@ -37,9 +39,6 @@
switch ($this->getTransactionType()) {
case self::TYPE_PARTICIPANTS:
return ($old === null);
- case self::TYPE_TITLE:
- case self::TYPE_TOPIC:
- case self::TYPE_PICTURE:
case self::TYPE_DATE_MARKER:
return false;
}
@@ -54,12 +53,9 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case self::TYPE_TITLE:
- case self::TYPE_TOPIC:
case PhabricatorTransactions::TYPE_VIEW_POLICY:
case PhabricatorTransactions::TYPE_EDIT_POLICY:
case PhabricatorTransactions::TYPE_JOIN_POLICY:
- case self::TYPE_PICTURE:
return $this->getRoomTitle();
break;
case self::TYPE_PARTICIPANTS:
@@ -94,55 +90,6 @@
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();
@@ -150,45 +97,6 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case self::TYPE_TITLE:
- if ($old && $new) {
- $title = pht(
- '%s renamed this room from "%s" to "%s".',
- $this->renderHandleLink($author_phid),
- $old,
- $new);
- } else if ($old) {
- $title = pht(
- '%s deleted the room name "%s".',
- $this->renderHandleLink($author_phid),
- $old);
- } else {
- $title = pht(
- '%s named this room "%s".',
- $this->renderHandleLink($author_phid),
- $new);
- }
- return $title;
- break;
- case self::TYPE_TOPIC:
- if ($new) {
- $title = pht(
- '%s set the topic of this room to "%s".',
- $this->renderHandleLink($author_phid),
- $new);
- } else if ($old) {
- $title = pht(
- '%s deleted the room topic "%s"',
- $this->renderHandleLink($author_phid),
- $old);
- }
- return $title;
- break;
- case self::TYPE_PICTURE:
- return pht(
- '%s updated the room image.',
- $this->renderHandleLink($author_phid));
- break;
case PhabricatorTransactions::TYPE_VIEW_POLICY:
return pht(
'%s changed the visibility of this room from "%s" to "%s".',
@@ -221,8 +129,6 @@
$phids[] = $this->getAuthorPHID();
switch ($this->getTransactionType()) {
- case self::TYPE_TITLE:
- case self::TYPE_PICTURE:
case self::TYPE_DATE_MARKER:
break;
case self::TYPE_PARTICIPANTS:
diff --git a/src/applications/conpherence/view/ConpherenceTransactionView.php b/src/applications/conpherence/view/ConpherenceTransactionView.php
--- a/src/applications/conpherence/view/ConpherenceTransactionView.php
+++ b/src/applications/conpherence/view/ConpherenceTransactionView.php
@@ -216,17 +216,6 @@
$content = null;
$handles = $this->getHandles();
switch ($transaction->getTransactionType()) {
- case ConpherenceTransaction::TYPE_TITLE:
- case ConpherenceTransaction::TYPE_TOPIC:
- case ConpherenceTransaction::TYPE_PICTURE:
- case ConpherenceTransaction::TYPE_PARTICIPANTS:
- case PhabricatorTransactions::TYPE_VIEW_POLICY:
- case PhabricatorTransactions::TYPE_EDIT_POLICY:
- case PhabricatorTransactions::TYPE_JOIN_POLICY:
- case PhabricatorTransactions::TYPE_EDGE:
- $content = $transaction->getTitle();
- $this->addClass('conpherence-edited');
- break;
case PhabricatorTransactions::TYPE_COMMENT:
$this->addClass('conpherence-comment');
$author = $handles[$transaction->getAuthorPHID()];
@@ -236,6 +225,10 @@
PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
$content_class = 'conpherence-message';
break;
+ default:
+ $content = $transaction->getTitle();
+ $this->addClass('conpherence-edited');
+ break;
}
$view = phutil_tag(
diff --git a/src/applications/conpherence/xaction/ConpherenceThreadPictureTransaction.php b/src/applications/conpherence/xaction/ConpherenceThreadPictureTransaction.php
new file mode 100644
--- /dev/null
+++ b/src/applications/conpherence/xaction/ConpherenceThreadPictureTransaction.php
@@ -0,0 +1,29 @@
+<?php
+
+final class ConpherenceThreadPictureTransaction
+ extends ConpherenceThreadTransactionType {
+
+ const TRANSACTIONTYPE = 'picture';
+
+ public function generateOldValue($object) {
+ return $object->getProfileImagePHID();
+ }
+
+ public function applyInternalEffects($object, $value) {
+ $object->setProfileImagePHID($value);
+ }
+
+ public function getTitle() {
+ return pht(
+ '%s updated the room image.',
+ $this->renderAuthor());
+ }
+
+ public function getTitleForFeed() {
+ return pht(
+ '%s updated the room image for %s.',
+ $this->renderAuthor(),
+ $this->renderObject());
+ }
+
+}
diff --git a/src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php b/src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php
new file mode 100644
--- /dev/null
+++ b/src/applications/conpherence/xaction/ConpherenceThreadTitleTransaction.php
@@ -0,0 +1,75 @@
+<?php
+
+final class ConpherenceThreadTitleTransaction
+ extends ConpherenceThreadTransactionType {
+
+ const TRANSACTIONTYPE = 'title';
+
+ public function generateOldValue($object) {
+ return $object->getTitle();
+ }
+
+ public function applyInternalEffects($object, $value) {
+ $object->setTitle($value);
+ }
+
+ public function getTitle() {
+ $old = $this->getOldValue();
+ $new = $this->getNewValue();
+
+ if (strlen($old) && strlen($new)) {
+ return pht(
+ '%s renamed this room from %s to %s.',
+ $this->renderAuthor(),
+ $this->renderOldValue(),
+ $this->renderNewValue());
+ } else {
+ return pht(
+ '%s created this room.',
+ $this->renderAuthor());
+ }
+ }
+
+ public function getTitleForFeed() {
+ $old = $this->getOldValue();
+ $new = $this->getNewValue();
+
+ if (strlen($old) && strlen($new)) {
+ return pht(
+ '%s renamed %s from %s to %s.',
+ $this->renderAuthor(),
+ $this->renderObject(),
+ $this->renderOldValue(),
+ $this->renderNewValue());
+ } else {
+ return pht(
+ '%s created %s.',
+ $this->renderAuthor(),
+ $this->renderObject());
+ }
+ }
+
+
+ public function validateTransactions($object, array $xactions) {
+ $errors = array();
+
+ if ($this->isEmptyTextTransaction($object->getTitle(), $xactions)) {
+ $errors[] = $this->newRequiredError(
+ pht('Rooms must have a title.'));
+ }
+
+ $max_length = $object->getColumnMaximumByteLength('title');
+ foreach ($xactions as $xaction) {
+ $new_value = $xaction->getNewValue();
+ $new_length = strlen($new_value);
+ if ($new_length > $max_length) {
+ $errors[] = $this->newInvalidError(
+ pht('The title can be no longer than %s characters.',
+ new PhutilNumber($max_length)));
+ }
+ }
+
+ return $errors;
+ }
+
+}
diff --git a/src/applications/conpherence/xaction/ConpherenceThreadTopicTransaction.php b/src/applications/conpherence/xaction/ConpherenceThreadTopicTransaction.php
new file mode 100644
--- /dev/null
+++ b/src/applications/conpherence/xaction/ConpherenceThreadTopicTransaction.php
@@ -0,0 +1,69 @@
+<?php
+
+final class ConpherenceThreadTopicTransaction
+ extends ConpherenceThreadTransactionType {
+
+ const TRANSACTIONTYPE = 'topic';
+
+ public function generateOldValue($object) {
+ return $object->getTopic();
+ }
+
+ public function applyInternalEffects($object, $value) {
+ $object->setTopic($value);
+ }
+
+ public function getTitle() {
+ $old = $this->getOldValue();
+ $new = $this->getNewValue();
+
+ if (strlen($new)) {
+ return pht(
+ '%s set the room topic to %s.',
+ $this->renderAuthor(),
+ $this->renderNewValue());
+ } else {
+ return pht(
+ '%s removed the room topic.',
+ $this->renderAuthor());
+ }
+
+ }
+
+ public function getTitleForFeed() {
+ $old = $this->getOldValue();
+ $new = $this->getNewValue();
+
+ if (strlen($new)) {
+ return pht(
+ '%s set the room topic to %s in %s.',
+ $this->renderAuthor(),
+ $this->renderNewValue(),
+ $this->renderObject());
+ } else {
+ return pht(
+ '%s removed the room topic for %s.',
+ $this->renderAuthor(),
+ $this->renderObject());
+ }
+
+ }
+
+ public function validateTransactions($object, array $xactions) {
+ $errors = array();
+
+ $max_length = $object->getColumnMaximumByteLength('topic');
+ foreach ($xactions as $xaction) {
+ $new_value = $xaction->getNewValue();
+ $new_length = strlen($new_value);
+ if ($new_length > $max_length) {
+ $errors[] = $this->newInvalidError(
+ pht('The topic can be no longer than %s characters.',
+ new PhutilNumber($max_length)));
+ }
+ }
+
+ return $errors;
+ }
+
+}
diff --git a/src/applications/conpherence/xaction/ConpherenceThreadTransactionType.php b/src/applications/conpherence/xaction/ConpherenceThreadTransactionType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/conpherence/xaction/ConpherenceThreadTransactionType.php
@@ -0,0 +1,4 @@
+<?php
+
+abstract class ConpherenceThreadTransactionType
+ extends PhabricatorModularTransactionType {}
diff --git a/webroot/rsrc/css/phui/phui-timeline-view.css b/webroot/rsrc/css/phui/phui-timeline-view.css
--- a/webroot/rsrc/css/phui/phui-timeline-view.css
+++ b/webroot/rsrc/css/phui/phui-timeline-view.css
@@ -256,7 +256,9 @@
color: {$lightgreytext};
}
-.phui-timeline-title .phui-timeline-value {
+.phui-timeline-title .phui-timeline-value,
+.conpherence-transaction-content .phui-timeline-value,
+.phui-feed-story-head .phui-timeline-value {
font-style: italic;
color: black;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 18, 11:32 PM (1 h, 43 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7013199
Default Alt Text
D17668.diff (28 KB)
Attached To
Mode
D17668: Modernize Conpherence with Modular Transactions
Attached
Detach File
Event Timeline
Log In to Comment