@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Route reply handler Maniphest writes through new transaction code

Summary: Ref T2217. Mail writes go through the new code now.

Test Plan: Shipped a bunch of mail in with `./bin/mail`, got reasonable edits as a result.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2217

Differential Revision: https://secure.phabricator.com/D7086

+24 -15
+24 -15
src/applications/maniphest/mail/ManiphestReplyHandler.php
··· 56 56 'id' => $mail->getID(), 57 57 )); 58 58 59 - $template = new ManiphestTransaction(); 60 - $template->setContentSource($content_source); 61 - $template->setAuthorPHID($user->getPHID()); 59 + $template = new ManiphestTransactionPro(); 62 60 63 61 $is_unsub = false; 64 62 if ($is_new_task) { ··· 112 110 break; 113 111 } 114 112 115 - $xaction = clone $template; 116 - $xaction->setTransactionType($ttype); 117 - $xaction->setNewValue($new_value); 118 - $xaction->setComments($body); 113 + if ($ttype != PhabricatorTransactions::TYPE_COMMENT) { 114 + $xaction = clone $template; 115 + $xaction->setTransactionType($ttype); 116 + $xaction->setNewValue($new_value); 117 + $xactions[] = $xaction; 118 + } 119 + 120 + if (strlen($body)) { 121 + $xaction = clone $template; 122 + $xaction->setTransactionType(PhabricatorTransactions::TYPE_COMMENT); 123 + $xaction->attachComment( 124 + id(new ManiphestTransactionComment()) 125 + ->setContent($body)); 126 + $xactions[] = $xaction; 127 + } 119 128 120 - $xactions[] = $xaction; 121 129 } 122 130 123 131 $ccs = $mail->loadCCPHIDs(); ··· 149 157 $task = $event->getValue('task'); 150 158 $xactions = $event->getValue('transactions'); 151 159 152 - 153 - $editor = new ManiphestTransactionEditor(); 154 - $editor->setActor($user); 155 - $editor->setParentMessageID($mail->getMessageID()); 156 - $editor->setExcludeMailRecipientPHIDs( 157 - $this->getExcludeMailRecipientPHIDs()); 158 - $editor->applyTransactions($task, $xactions); 160 + $editor = id(new ManiphestTransactionEditorPro()) 161 + ->setActor($user) 162 + ->setParentMessageID($mail->getMessageID()) 163 + ->setExcludeMailRecipientPHIDs($this->getExcludeMailRecipientPHIDs()) 164 + ->setContinueOnNoEffect(true) 165 + ->setContinueOnMissingFields(true) 166 + ->setContentSource($content_source) 167 + ->applyTransactions($task, $xactions); 159 168 160 169 $event = new PhabricatorEvent( 161 170 PhabricatorEventType::TYPE_MANIPHEST_DIDEDITTASK,