Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13978026
D8427.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D8427.diff
View Options
Index: src/applications/differential/mail/DifferentialReplyHandler.php
===================================================================
--- src/applications/differential/mail/DifferentialReplyHandler.php
+++ src/applications/differential/mail/DifferentialReplyHandler.php
@@ -129,28 +129,48 @@
$body = $this->enhanceBodyWithAttachments($body, $attachments);
+ $xactions = array();
+
+ if ($command && ($command != DifferentialAction::ACTION_COMMENT)) {
+ $xactions[] = id(new DifferentialTransaction())
+ ->setTransactionType(DifferentialTransaction::TYPE_ACTION)
+ ->setNewValue($command);
+ }
+
+ if (strlen($body)) {
+ $xactions[] = id(new DifferentialTransaction())
+ ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
+ ->attachComment(
+ id(new DifferentialTransactionComment())
+ ->setContent($body));
+ }
+
+ $editor = id(new DifferentialTransactionEditor())
+ ->setActor($actor)
+ ->setExcludeMailRecipientPHIDs($this->getExcludeMailRecipientPHIDs())
+ ->setContinueOnMissingFields(true)
+ ->setContinueOnNoEffect(true);
+
+ // NOTE: We have to be careful about this because Facebook's
+ // implementation jumps straight into handleAction() and will not have
+ // a PhabricatorMetaMTAReceivedMail object.
+ if ($this->receivedMail) {
+ $content_source = PhabricatorContentSource::newForSource(
+ PhabricatorContentSource::SOURCE_EMAIL,
+ array(
+ 'id' => $this->receivedMail->getID(),
+ ));
+ $editor->setContentSource($content_source);
+ $editor->setParentMessageID($this->receivedMail->getMessageID());
+ } else {
+ $content_source = PhabricatorContentSource::newForSource(
+ PhabricatorContentSource::SOURCE_LEGACY,
+ array());
+ $editor->setContentSource($content_source);
+ }
+
try {
- $editor = new DifferentialCommentEditor(
- $this->getMailReceiver(),
- $command);
- $editor->setActor($actor);
- $editor->setExcludeMailRecipientPHIDs(
- $this->getExcludeMailRecipientPHIDs());
-
- // NOTE: We have to be careful about this because Facebook's
- // implementation jumps straight into handleAction() and will not have
- // a PhabricatorMetaMTAReceivedMail object.
- if ($this->receivedMail) {
- $content_source = PhabricatorContentSource::newForSource(
- PhabricatorContentSource::SOURCE_EMAIL,
- array(
- 'id' => $this->receivedMail->getID(),
- ));
- $editor->setContentSource($content_source);
- $editor->setParentMessageID($this->receivedMail->getMessageID());
- }
- $editor->setMessage($body);
- $editor->save();
+ $editor->applyTransactions($this->getMailReceiver(), $xactions);
} catch (Exception $ex) {
if ($this->receivedMail) {
$error_body = $this->receivedMail->getRawTextBody();
Index: src/applications/differential/mail/DifferentialRevisionMailReceiver.php
===================================================================
--- src/applications/differential/mail/DifferentialRevisionMailReceiver.php
+++ src/applications/differential/mail/DifferentialRevisionMailReceiver.php
@@ -18,6 +18,7 @@
$results = id(new DifferentialRevisionQuery())
->setViewer($viewer)
->withIDs(array($id))
+ ->needReviewerStatus(true)
->execute();
return head($results);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 19 2024, 9:11 PM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6714291
Default Alt Text
D8427.diff (3 KB)
Attached To
Mode
D8427: Use TransactionEditor in Differential mail handling
Attached
Detach File
Event Timeline
Log In to Comment