Page MenuHomePhabricator

D12704.id30502.diff
No OneTemporary

D12704.id30502.diff

diff --git a/src/applications/differential/query/DifferentialInlineCommentQuery.php b/src/applications/differential/query/DifferentialInlineCommentQuery.php
--- a/src/applications/differential/query/DifferentialInlineCommentQuery.php
+++ b/src/applications/differential/query/DifferentialInlineCommentQuery.php
@@ -148,6 +148,13 @@
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');
diff --git a/src/applications/settings/panel/PhabricatorDiffPreferencesSettingsPanel.php b/src/applications/settings/panel/PhabricatorDiffPreferencesSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorDiffPreferencesSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorDiffPreferencesSettingsPanel.php
@@ -20,6 +20,7 @@
$preferences = $user->loadPreferences();
$pref_unified = PhabricatorUserPreferences::PREFERENCE_DIFF_UNIFIED;
+ $pref_ghosts = PhabricatorUserPreferences::PREFERENCE_DIFF_GHOSTS;
$pref_filetree = PhabricatorUserPreferences::PREFERENCE_DIFF_FILETREE;
if ($request->isFormPost()) {
@@ -36,6 +37,9 @@
$unified = $request->getStr($pref_unified);
$preferences->setPreference($pref_unified, $unified);
+ $ghosts = $request->getStr($pref_ghosts);
+ $preferences->setPreference($pref_ghosts, $ghosts);
+
$preferences->save();
return id(new AphrontRedirectResponse())
->setURI($this->getPanelURI('?saved=true'));
@@ -62,6 +66,16 @@
)))
->appendChild(
id(new AphrontFormSelectControl())
+ ->setLabel(pht('Show Older Inlines'))
+ ->setName($pref_ghosts)
+ ->setValue($preferences->getPreference($pref_ghosts))
+ ->setOptions(
+ array(
+ 'default' => pht('Enabled'),
+ 'disabled' => pht('Disabled'),
+ )))
+ ->appendChild(
+ id(new AphrontFormSelectControl())
->setLabel(pht('Show Filetree'))
->setName($pref_filetree)
->setValue($preferences->getPreference($pref_filetree))
diff --git a/src/applications/settings/storage/PhabricatorUserPreferences.php b/src/applications/settings/storage/PhabricatorUserPreferences.php
--- a/src/applications/settings/storage/PhabricatorUserPreferences.php
+++ b/src/applications/settings/storage/PhabricatorUserPreferences.php
@@ -31,6 +31,7 @@
const PREFERENCE_DIFF_UNIFIED = 'diff-unified';
const PREFERENCE_DIFF_FILETREE = 'diff-filetree';
+ const PREFERENCE_DIFF_GHOSTS = 'diff-ghosts';
const PREFERENCE_CONPH_NOTIFICATIONS = 'conph-notifications';
const PREFERENCE_CONPHERENCE_COLUMN = 'conpherence-column';

File Metadata

Mime Type
text/plain
Expires
Fri, Sep 20, 10:10 AM (14 h, 41 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6623318
Default Alt Text
D12704.id30502.diff (2 KB)

Event Timeline