Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15331344
D21402.id.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
D21402.id.diff
View Options
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -4968,8 +4968,7 @@
private function hasWarnings($object, $xaction) {
// TODO: For the moment, this is a very un-modular hack to support
- // exactly one type of warning (mentioning users on a draft revision)
- // that we want to show. See PHI433.
+ // a small number of warnings related to draft revisions. See PHI433.
if (!($object instanceof DifferentialRevision)) {
return false;
@@ -4991,8 +4990,21 @@
return false;
}
- // NOTE: This will currently warn even if you're only removing
- // subscribers.
+ // We're only going to raise a warning if the transaction adds subscribers
+ // other than the acting user. (This implementation is clumsy because the
+ // code runs before a lot of normalization occurs.)
+
+ $old = $this->getTransactionOldValue($object, $xaction);
+ $new = $this->getPHIDTransactionNewValue($xaction, $old);
+ $old = array_fuse($old);
+ $new = array_fuse($new);
+ $add = array_diff_key($new, $old);
+
+ unset($add[$this->getActingAsPHID()]);
+
+ if (!$add) {
+ return false;
+ }
return true;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 8, 9:10 AM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7311683
Default Alt Text
D21402.id.diff (1 KB)
Attached To
Mode
D21402: Don't raise the "Subscribers Won't Be Notified" draft warning if you aren't adding any non-you subscribers
Attached
Detach File
Event Timeline
Log In to Comment