Maniphest - use subscribers framework properly

Summary: Fixes T5604. This should fix some random bugs, lets us move forward more easily, and all that good stuff about killing code debt.

Test Plan:
- Conduit method maniphest.createtask
  - verified creating user subscribed
  - verified subscription transaction
- Conduit method maniphest.update
  - verified subscribers set as specified to ccPHIDs parameter
  - verified subscription transaction
- Herald
  - verified herald rule to add subscriber worked
  - verified no subscribers removed accidentally
- edit controller
  - test create and verify author gets added IFF they put themselves in subscribers control box
  - test update gets set to exactly what user enters
- lipsum generator'd tasks work
- bulk add subscribers works
- bulk remove subscriber works
- detail controller
  - added myself by leaving a comment
  - added another user via explicit action
  - added another user via implicit mention
- task merge via search attach controller
- mail reply handler
  - add subscriber via ./bin/mail receive-test
  - unsubscribe via ./bin/mail receive-test

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T5604

Differential Revision: https://secure.phabricator.com/D10965
This commit is contained in:
Bob Trahan
2014-12-10 16:27:30 -08:00
parent 3297bc2ed9
commit 7d96870570
27 changed files with 195 additions and 230 deletions

View File

@@ -58,22 +58,19 @@ final class ManiphestTransactionPreviewController extends ManiphestController {
}
$transaction->setNewValue($value);
break;
case ManiphestTransaction::TYPE_CCS:
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
if ($value) {
$value = json_decode($value);
}
if (!$value) {
$value = array();
}
$phids = $value;
foreach ($task->getCCPHIDs() as $cc_phid) {
$phids = array();
foreach ($value as $cc_phid) {
$phids[] = $cc_phid;
$value[] = $cc_phid;
}
$transaction->setOldValue($task->getCCPHIDs());
$transaction->setNewValue($value);
$transaction->setOldValue(array());
$transaction->setNewValue($phids);
break;
case ManiphestTransaction::TYPE_PROJECTS:
if ($value) {