Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15190803
D12704.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12704.id.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 22, 10:16 PM (4 h, 11 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7182946
Default Alt Text
D12704.id.diff (2 KB)
Attached To
Mode
D12704: Add a preference to disable ghost comments
Attached
Detach File
Event Timeline
Log In to Comment