Use transactions properly when building tasks from email
Summary: Fixes T5859. This doesn't change much, but makes the transaction record a little more accurate and activates stuff like `#hashtags` and `{F123}` causing policy associations.
Test Plan: Used `bin/mail receive-test` and mail receiver script to send bug mail, saw hashtags imply projects.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T5859
Differential Revision: https://secure.phabricator.com/D10229
This commit is contained in:
@@ -57,17 +57,19 @@ final class ManiphestReplyHandler extends PhabricatorMailReplyHandler {
|
||||
|
||||
$is_unsub = false;
|
||||
if ($is_new_task) {
|
||||
// If this is a new task, create a "User created this task." transaction
|
||||
// and then set the title and description.
|
||||
$xaction = clone $template;
|
||||
$xaction->setTransactionType(ManiphestTransaction::TYPE_STATUS);
|
||||
$xaction->setNewValue(ManiphestTaskStatus::getDefaultStatus());
|
||||
$xactions[] = $xaction;
|
||||
$task = ManiphestTask::initializeNewTask($user);
|
||||
|
||||
$task->setAuthorPHID($user->getPHID());
|
||||
$task->setTitle(nonempty($mail->getSubject(), 'Untitled Task'));
|
||||
$task->setDescription($body);
|
||||
$task->setPriority(ManiphestTaskPriority::getDefaultPriority());
|
||||
$xactions[] = id(new ManiphestTransaction())
|
||||
->setTransactionType(ManiphestTransaction::TYPE_STATUS)
|
||||
->setNewValue(ManiphestTaskStatus::getDefaultStatus());
|
||||
|
||||
$xactions[] = id(new ManiphestTransaction())
|
||||
->setTransactionType(ManiphestTransaction::TYPE_TITLE)
|
||||
->setNewValue(nonempty($mail->getSubject(), pht('Untitled Task')));
|
||||
|
||||
$xactions[] = id(new ManiphestTransaction())
|
||||
->setTransactionType(ManiphestTransaction::TYPE_DESCRIPTION)
|
||||
->setNewValue($body);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user