Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15307779
D10244.id.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
D10244.id.diff
View Options
diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php
--- a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php
+++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php
@@ -38,10 +38,36 @@
->withPHIDs(array($obj_phid))
->executeOne();
+ $title = pht('Raw Comment');
+ $body = $xaction->getComment()->getContent();
+ $addendum = null;
+ if ($request->getExists('email')) {
+ $content_source = $xaction->getContentSource();
+ $source_email = PhabricatorContentSource::SOURCE_EMAIL;
+ if ($content_source->getSource() == $source_email) {
+ $source_id = $content_source->getParam('id');
+ if ($source_id) {
+ $message = id(new PhabricatorMetaMTAReceivedMail())->loadOneWhere(
+ 'id = %d',
+ $source_id);
+ if ($message) {
+ $title = pht('Email Body Text');
+ $body = $message->getRawTextBody();
+ $details_text = pht(
+ 'For full details, run `/bin/mail show-outbound --id %d`',
+ $source_id);
+ $addendum = PhabricatorMarkupEngine::renderOneObject(
+ id(new PhabricatorMarkupOneOff())->setContent($details_text),
+ 'default',
+ $user);
+ }
+ }
+ }
+ }
$dialog = id(new AphrontDialogView())
->setUser($user)
->addCancelButton($obj_handle->getURI())
- ->setTitle(pht('Raw Comment'));
+ ->setTitle($title);
$dialog
->addHiddenInput('anchor', $request->getStr('anchor'))
@@ -51,7 +77,10 @@
->appendChild(
id(new AphrontFormTextAreaControl())
->setReadOnly(true)
- ->setValue($xaction->getComment()->getContent())));
+ ->setValue($body)));
+ if ($addendum) {
+ $dialog->appendParagraph($addendum);
+ }
return id(new AphrontDialogResponse())->setDialog($dialog);
}
diff --git a/src/view/phui/PHUITimelineEventView.php b/src/view/phui/PHUITimelineEventView.php
--- a/src/view/phui/PHUITimelineEventView.php
+++ b/src/view/phui/PHUITimelineEventView.php
@@ -539,6 +539,23 @@
array(
'anchor' => $anchor,
));
+
+ $content_source = $this->getContentSource();
+ $source_email = PhabricatorContentSource::SOURCE_EMAIL;
+ if ($content_source->getSource() == $source_email) {
+ $source_id = $content_source->getParam('id');
+ if ($source_id) {
+ $items[] = id(new PhabricatorActionView())
+ ->setIcon('fa-envelope-o')
+ ->setHref('/transactions/raw/'.$xaction_phid.'/?email')
+ ->setName(pht('View Email Body'))
+ ->addSigil('transaction-raw')
+ ->setMetadata(
+ array(
+ 'anchor' => $anchor,
+ ));
+ }
+ }
}
if ($this->getIsRemovable()) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 7, 5:31 AM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7226223
Default Alt Text
D10244.id.diff (3 KB)
Attached To
Mode
D10244: Add "View Email" action to application transactions
Attached
Detach File
Event Timeline
Log In to Comment