Add a preference to disable ghost comments

Summary: Ref T7447. At least some users dislike this feature so strongly that they'd prefer not to have it at all.

Test Plan: Viewed ghosts; toggled preference, no more ghosts.

Reviewers: chad

Reviewed By: chad

Subscribers: yelirekim, epriestley

Maniphest Tasks: T7447

Differential Revision: https://secure.phabricator.com/D12704
This commit is contained in:
epriestley
2015-05-04 12:02:42 -07:00
parent 861155ea73
commit 29feca3c1e
3 changed files with 22 additions and 0 deletions

View File

@@ -148,6 +148,13 @@ final class DifferentialInlineCommentQuery
assert_instances_of($new, 'DifferentialChangeset');
$viewer = $this->getViewer();
$pref = $viewer->loadPreferences()->getPreference(
PhabricatorUserPreferences::PREFERENCE_DIFF_GHOSTS);
if ($pref == 'disabled') {
return $inlines;
}
$all = array_merge($old, $new);
$changeset_ids = mpull($inlines, 'getChangesetID');