Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14738959
D14014.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14014.diff
View Options
diff --git a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
--- a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
+++ b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
@@ -211,14 +211,14 @@
->addSigil('differential-inline-next')
->setMustCapture(true);
- $hide = id(new PHUIButtonView())
- ->setTag('a')
- ->setTooltip(pht('Hide Comment'))
- ->setIconFont('fa-times')
- ->addSigil('hide-inline')
- ->setMustCapture(true);
+ if ($this->canHide()) {
+ $hide = id(new PHUIButtonView())
+ ->setTag('a')
+ ->setTooltip(pht('Hide Comment'))
+ ->setIconFont('fa-times')
+ ->addSigil('hide-inline')
+ ->setMustCapture(true);
- if ($viewer_phid && $inline->getID() && $inline->supportsHiding()) {
$nextprev->addButton($hide);
}
@@ -456,4 +456,27 @@
return $markup;
}
+ private function canHide() {
+ $inline = $this->inlineComment;
+
+ if ($inline->isDraft()) {
+ return false;
+ }
+
+ if (!$inline->getID()) {
+ return false;
+ }
+
+ $viewer = $this->getUser();
+ if (!$viewer->isLoggedIn()) {
+ return false;
+ }
+
+ if (!$inline->supportsHiding()) {
+ return false;
+ }
+
+ return true;
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 20, 5:42 PM (21 h, 54 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7023417
Default Alt Text
D14014.diff (1 KB)
Attached To
Mode
D14014: Prevent users from hiding unpublished inlines
Attached
Detach File
Event Timeline
Log In to Comment