From 9419e4f13a5372c06371769630c0a6936af754ba Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 20 Apr 2016 14:35:20 -0700 Subject: [PATCH] Reduce strength of Herald and user subscription stories Summary: Fixes T8952. When Herald changes subscribers, it is zzzzz very boring. When users change subscribers, it is still super boring (more boring than a merge, for example). Test Plan: Viewed feed, saw fewer Herald stories. Reviewers: chad Reviewed By: chad Maniphest Tasks: T8952 Differential Revision: https://secure.phabricator.com/D15774 --- .../PhabricatorApplicationTransaction.php | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php index e3fe7707f6..ab22111647 100644 --- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php +++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php @@ -1227,7 +1227,17 @@ abstract class PhabricatorApplicationTransaction // Make this weaker than TYPE_COMMENT. return 0.25; } - break; + + if ($this->isApplicationAuthor()) { + // When applications (most often: Herald) change subscriptions it + // is very uninteresting. + return 0.000000001; + } + + // 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 1.0; @@ -1462,6 +1472,14 @@ abstract class PhabricatorApplicationTransaction return true; } + private function isApplicationAuthor() { + $author_phid = $this->getAuthorPHID(); + $author_type = phid_get_type($author_phid); + $application_type = PhabricatorApplicationApplicationPHIDType::TYPECONST; + return ($author_type == $application_type); + } + + private function getInterestingMoves(array $moves) { // Remove moves which only shift the position of a task within a column. foreach ($moves as $key => $move) {