Page MenuHomePhorge

Do not add actor as subscriber when removing a comment
ClosedPublic

Authored by aklapper on Aug 1 2024, 22:18.

Details

Summary

When an admin removes a comment (e.g. spam), the admin gets subscribed to the task. This is usually unwanted as the removal action does not imply that the admin is interested in receiving future notifications about the task, in contrast to e.g. adding a comment to a discussion in the task.

Any transaction of a comment (add, edit, remove) is a "core:comment" action. The code calls applyImplicitCC() which calls shouldImplyCC() which returns the bool $xaction->isCommentTransaction(). Expand this bool to $xaction->isCommentTransaction() && !($xaction->getComment()->getIsRemoved()).

Closes T15899

Test Plan
  • As an admin, go to a task which has comments and to which you are not subscribed
  • Click the dropdown for the comment, select Remove comment
  • See that you did not get subscribed to the task

Diff Detail

Repository
rP Phorge
Branch
T15899removeCommentSubscribe
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1489
Build 1489: arc lint + arc unit

Event Timeline

aklapper requested review of this revision.Aug 1 2024, 22:18

Tested, makes sense, lovely feature, no possible NULL pointers since isCommentTransaction() calls hasComment() that eliminates the possibility of getComment() being NULL; no possibility to get exception "Comment for this transaction was not loaded" since that was already checked with just isCommentTransaction(); green light 🌈

This revision is now accepted and ready to land.Aug 2 2024, 08:28