Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14014489
D19035.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
D19035.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
@@ -1516,6 +1516,37 @@
$new_texts);
$phids = array_diff($new_phids, $old_phids);
+
+ // Count any users who were explicitly added as subscribers (other than
+ // the actor) as "mentioned". If someone: just adds another user as a
+ // subscriber; or adds them as a subscriber explicitly, then writes a
+ // comment without actually "@mentioning" them, we still want it to
+ // behave like a mention for the purposes of mail stamps.
+
+ $subscriber_type = PhabricatorTransactions::TYPE_SUBSCRIBERS;
+ $old_state = array_values($this->subscribers);
+ $old_state = array_fuse($old_state);
+ foreach ($xactions as $xaction) {
+ if ($xaction->getTransactionType() != $subscriber_type) {
+ continue;
+ }
+
+ $new_value = $xaction->getNewValue();
+
+ $new_phids = array_merge(
+ idx($new_value, '=', array()),
+ idx($new_value, '+', array()));
+
+ foreach ($new_phids as $phid) {
+ if ($phid === $this->getActingAsPHID()) {
+ continue;
+ }
+
+ if (!isset($old_state[$phid])) {
+ $phids[] = $phid;
+ }
+ }
+ }
} else {
$phids = array();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 4, 5:34 AM (22 h, 1 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715396
Default Alt Text
D19035.diff (1 KB)
Attached To
Mode
D19035: When users are subscribed explicitly, count them as "mentioned"
Attached
Detach File
Event Timeline
Log In to Comment