Page MenuHomePhabricator

D21402.id.diff
No OneTemporary

D21402.id.diff

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

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)

Event Timeline