Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2619388
D25760.1731641094.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
D25760.1731641094.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
@@ -3299,7 +3299,10 @@
/**
- * When a user interacts with an object, we might want to add them to CC.
+ * Adds the actor as a subscriber to the object with which they interact
+ * @param PhabricatorLiskDAO $object on which the action is performed
+ * @param array $xactions Transactions to apply
+ * @return array Transactions to apply
*/
final public function applyImplicitCC(
PhabricatorLiskDAO $object,
@@ -3381,11 +3384,18 @@
return $xactions;
}
+ /**
+ * Whether the action implies the actor should be subscribed on the object
+ * @param PhabricatorLiskDAO $object on which the action is performed
+ * @param PhabricatorApplicationTransaction $xaction Transaction to apply
+ * @return bool True if the actor should be subscribed on the object
+ */
protected function shouldImplyCC(
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
- return $xaction->isCommentTransaction();
+ return ($xaction->isCommentTransaction() &&
+ !($xaction->getComment()->getIsRemoved()));
}
diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
--- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
+++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
@@ -1580,6 +1580,10 @@
return 100;
}
+ /**
+ * Whether the transaction concerns a comment (e.g. add, edit, remove)
+ * @return bool True if the transaction concerns a comment
+ */
public function isCommentTransaction() {
if ($this->hasComment()) {
return true;
diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php b/src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php
--- a/src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php
+++ b/src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php
@@ -74,6 +74,10 @@
return PhabricatorContentSource::newFromSerialized($this->contentSource);
}
+ /**
+ * Whether the transaction removes the comment
+ * @return bool True if the transaction removes the comment
+ */
public function getIsRemoved() {
return ($this->getIsDeleted() == 2);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 15, 03:24 (11 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
971009
Default Alt Text
D25760.1731641094.diff (2 KB)
Attached To
Mode
D25760: Do not add actor as subscriber when removing a comment
Attached
Detach File
Event Timeline
Log In to Comment