Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15439359
D20540.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
9 KB
Referenced Files
None
Subscribers
None
D20540.diff
View Options
diff --git a/src/applications/audit/storage/PhabricatorAuditTransaction.php b/src/applications/audit/storage/PhabricatorAuditTransaction.php
--- a/src/applications/audit/storage/PhabricatorAuditTransaction.php
+++ b/src/applications/audit/storage/PhabricatorAuditTransaction.php
@@ -50,7 +50,7 @@
switch ($type) {
case self::TYPE_COMMIT:
- return 3.0;
+ return 300;
}
return parent::getActionStrength();
diff --git a/src/applications/differential/storage/DifferentialTransaction.php b/src/applications/differential/storage/DifferentialTransaction.php
--- a/src/applications/differential/storage/DifferentialTransaction.php
+++ b/src/applications/differential/storage/DifferentialTransaction.php
@@ -130,7 +130,7 @@
public function getActionStrength() {
switch ($this->getTransactionType()) {
case self::TYPE_ACTION:
- return 3;
+ return 300;
}
return parent::getActionStrength();
diff --git a/src/applications/differential/xaction/DifferentialRevisionActionTransaction.php b/src/applications/differential/xaction/DifferentialRevisionActionTransaction.php
--- a/src/applications/differential/xaction/DifferentialRevisionActionTransaction.php
+++ b/src/applications/differential/xaction/DifferentialRevisionActionTransaction.php
@@ -40,7 +40,7 @@
}
public function getActionStrength() {
- return 3;
+ return 300;
}
public function getRevisionActionOrderVector() {
diff --git a/src/applications/differential/xaction/DifferentialRevisionUpdateTransaction.php b/src/applications/differential/xaction/DifferentialRevisionUpdateTransaction.php
--- a/src/applications/differential/xaction/DifferentialRevisionUpdateTransaction.php
+++ b/src/applications/differential/xaction/DifferentialRevisionUpdateTransaction.php
@@ -99,7 +99,7 @@
}
public function getActionStrength() {
- return 2;
+ return 200;
}
public function getTitle() {
diff --git a/src/applications/differential/xaction/DifferentialRevisionWrongBuildsTransaction.php b/src/applications/differential/xaction/DifferentialRevisionWrongBuildsTransaction.php
--- a/src/applications/differential/xaction/DifferentialRevisionWrongBuildsTransaction.php
+++ b/src/applications/differential/xaction/DifferentialRevisionWrongBuildsTransaction.php
@@ -26,7 +26,7 @@
}
public function getActionStrength() {
- return 4;
+ return 400;
}
public function getTitle() {
diff --git a/src/applications/differential/xaction/DifferentialRevisionWrongStateTransaction.php b/src/applications/differential/xaction/DifferentialRevisionWrongStateTransaction.php
--- a/src/applications/differential/xaction/DifferentialRevisionWrongStateTransaction.php
+++ b/src/applications/differential/xaction/DifferentialRevisionWrongStateTransaction.php
@@ -22,7 +22,7 @@
}
public function getActionStrength() {
- return 4;
+ return 400;
}
public function getTitle() {
diff --git a/src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.php
--- a/src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.php
@@ -31,7 +31,7 @@
}
public function getActionStrength() {
- return 1.2;
+ return 120;
}
public function getActionName() {
diff --git a/src/applications/maniphest/xaction/ManiphestTaskPriorityTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskPriorityTransaction.php
--- a/src/applications/maniphest/xaction/ManiphestTaskPriorityTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskPriorityTransaction.php
@@ -27,7 +27,7 @@
}
public function getActionStrength() {
- return 1.1;
+ return 110;
}
public function getActionName() {
diff --git a/src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php
--- a/src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php
@@ -22,7 +22,7 @@
}
public function getActionStrength() {
- return 1.3;
+ return 130;
}
public function getActionName() {
diff --git a/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
--- a/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
@@ -14,7 +14,7 @@
}
public function getActionStrength() {
- return 1.4;
+ return 140;
}
public function getActionName() {
diff --git a/src/applications/pholio/xaction/PholioMockNameTransaction.php b/src/applications/pholio/xaction/PholioMockNameTransaction.php
--- a/src/applications/pholio/xaction/PholioMockNameTransaction.php
+++ b/src/applications/pholio/xaction/PholioMockNameTransaction.php
@@ -10,7 +10,7 @@
}
public function getActionStrength() {
- return 1.4;
+ return 140;
}
public function applyInternalEffects($object, $value) {
diff --git a/src/applications/phriction/xaction/PhrictionDocumentDeleteTransaction.php b/src/applications/phriction/xaction/PhrictionDocumentDeleteTransaction.php
--- a/src/applications/phriction/xaction/PhrictionDocumentDeleteTransaction.php
+++ b/src/applications/phriction/xaction/PhrictionDocumentDeleteTransaction.php
@@ -19,7 +19,7 @@
}
public function getActionStrength() {
- return 1.5;
+ return 150;
}
public function getActionName() {
diff --git a/src/applications/phriction/xaction/PhrictionDocumentEditTransaction.php b/src/applications/phriction/xaction/PhrictionDocumentEditTransaction.php
--- a/src/applications/phriction/xaction/PhrictionDocumentEditTransaction.php
+++ b/src/applications/phriction/xaction/PhrictionDocumentEditTransaction.php
@@ -32,7 +32,7 @@
}
public function getActionStrength() {
- return 1.3;
+ return 130;
}
public function getActionName() {
diff --git a/src/applications/phriction/xaction/PhrictionDocumentMoveToTransaction.php b/src/applications/phriction/xaction/PhrictionDocumentMoveToTransaction.php
--- a/src/applications/phriction/xaction/PhrictionDocumentMoveToTransaction.php
+++ b/src/applications/phriction/xaction/PhrictionDocumentMoveToTransaction.php
@@ -37,7 +37,7 @@
}
public function getActionStrength() {
- return 1.0;
+ return 100;
}
public function getActionName() {
diff --git a/src/applications/phriction/xaction/PhrictionDocumentTitleTransaction.php b/src/applications/phriction/xaction/PhrictionDocumentTitleTransaction.php
--- a/src/applications/phriction/xaction/PhrictionDocumentTitleTransaction.php
+++ b/src/applications/phriction/xaction/PhrictionDocumentTitleTransaction.php
@@ -21,7 +21,7 @@
}
public function getActionStrength() {
- return 1.4;
+ return 140;
}
public function getActionName() {
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -3249,7 +3249,7 @@
protected function getStrongestAction(
PhabricatorLiskDAO $object,
array $xactions) {
- return last(msort($xactions, 'getActionStrength'));
+ return head(msort($xactions, 'newActionStrengthSortVector'));
}
@@ -3718,8 +3718,7 @@
PhabricatorLiskDAO $object,
array $xactions) {
- $xactions = msort($xactions, 'getActionStrength');
- $xactions = array_reverse($xactions);
+ $xactions = msortv($xactions, 'newActionStrengthSortVector');
return array(
'objectPHID' => $object->getPHID(),
diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
--- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
+++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
@@ -1363,35 +1363,35 @@
public function getActionStrength() {
if ($this->isInlineCommentTransaction()) {
- return 0.25;
+ return 250;
}
switch ($this->getTransactionType()) {
case PhabricatorTransactions::TYPE_COMMENT:
- return 0.5;
+ return 500;
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
if ($this->isSelfSubscription()) {
// Make this weaker than TYPE_COMMENT.
- return 0.25;
+ return 250;
}
if ($this->isApplicationAuthor()) {
// When applications (most often: Herald) change subscriptions it
// is very uninteresting.
- return 0.000000001;
+ return 1;
}
// In other cases, subscriptions are more interesting than comments
// (which are shown anyway) but less interesting than any other type of
// transaction.
- return 0.75;
+ return 750;
case PhabricatorTransactions::TYPE_MFA:
// We want MFA signatures to render at the top of transaction groups,
// on top of the things they signed.
- return 10;
+ return 10000;
}
- return 1.0;
+ return 1000;
}
public function isCommentTransaction() {
@@ -1717,6 +1717,11 @@
->addString($this->getPHID());
}
+ public function newActionStrengthSortVector() {
+ return id(new PhutilSortVector())
+ ->addInt(-$this->getActionStrength());
+ }
+
/* -( PhabricatorPolicyInterface Implementation )-------------------------- */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 27, 7:10 AM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7587736
Default Alt Text
D20540.diff (9 KB)
Attached To
Mode
D20540: Stabilize sorting of feed stories with similar strength
Attached
Detach File
Event Timeline
Log In to Comment