mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 21:32:43 +01:00
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:
parent
ec9eaabfbd
commit
a3a72c1c7d
1 changed files with 12 additions and 10 deletions
|
@ -57,17 +57,19 @@ final class ManiphestReplyHandler extends PhabricatorMailReplyHandler {
|
||||||
|
|
||||||
$is_unsub = false;
|
$is_unsub = false;
|
||||||
if ($is_new_task) {
|
if ($is_new_task) {
|
||||||
// If this is a new task, create a "User created this task." transaction
|
$task = ManiphestTask::initializeNewTask($user);
|
||||||
// and then set the title and description.
|
|
||||||
$xaction = clone $template;
|
|
||||||
$xaction->setTransactionType(ManiphestTransaction::TYPE_STATUS);
|
|
||||||
$xaction->setNewValue(ManiphestTaskStatus::getDefaultStatus());
|
|
||||||
$xactions[] = $xaction;
|
|
||||||
|
|
||||||
$task->setAuthorPHID($user->getPHID());
|
$xactions[] = id(new ManiphestTransaction())
|
||||||
$task->setTitle(nonempty($mail->getSubject(), 'Untitled Task'));
|
->setTransactionType(ManiphestTransaction::TYPE_STATUS)
|
||||||
$task->setDescription($body);
|
->setNewValue(ManiphestTaskStatus::getDefaultStatus());
|
||||||
$task->setPriority(ManiphestTaskPriority::getDefaultPriority());
|
|
||||||
|
$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 {
|
} else {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue