From 1327bd2c8acb32137fd8ceda7d891f63e4214d77 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 24 Sep 2013 10:49:29 -0700 Subject: [PATCH] Smooth "no effect" detection in Maniphest for @mentions Summary: Ref T2217. Since we aren't actually using subscriptions yet, the "transactions have no effect" detection can trigger for `@mention`s of users who are already CC'd on a task. Be more conservative about generating a CC transaction. Test Plan: See screenshot. Reviewers: btrahan, chad Reviewed By: chad CC: chad, aran Maniphest Tasks: T2217 Differential Revision: https://secure.phabricator.com/D7095 --- .../controller/ManiphestTransactionSaveController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/applications/maniphest/controller/ManiphestTransactionSaveController.php b/src/applications/maniphest/controller/ManiphestTransactionSaveController.php index c1ef68dfbe..4eabc8a695 100644 --- a/src/applications/maniphest/controller/ManiphestTransactionSaveController.php +++ b/src/applications/maniphest/controller/ManiphestTransactionSaveController.php @@ -197,10 +197,12 @@ final class ManiphestTransactionSaveController extends ManiphestController { } } + // Evade no-effect detection in the new editor stuff until we can switch + // to subscriptions. + $added_ccs = array_diff($added_ccs, $task->getCCPHIDs()); + if ($added_ccs || $force_cc_transaction) { - // We've added CCs, so include a CC transaction. It's safe to do this even - // if we're just "adding" CCs which already exist, because the - // ManiphestTransactionEditor is smart enough to ignore them. + // We've added CCs, so include a CC transaction. $all_ccs = array_merge($task->getCCPHIDs(), $added_ccs); $cc_transaction->setNewValue($all_ccs); $transactions[] = $cc_transaction;