3 final class PhabricatorApplicationTransactionCommentRawController
4 extends PhabricatorApplicationTransactionController
{
6 public function handleRequest(AphrontRequest
$request) {
7 $viewer = $this->getViewer();
8 $phid = $request->getURIData('phid');
10 $xaction = id(new PhabricatorObjectQuery())
11 ->withPHIDs(array($phid))
16 return new Aphront404Response();
19 if (!$xaction->getComment()) {
20 // You can't view a raw comment if there is no comment.
21 return new Aphront404Response();
24 if ($xaction->getComment()->getIsRemoved()) {
25 // You can't view a raw comment if the comment is deleted.
26 return new Aphront400Response();
29 $obj_phid = $xaction->getObjectPHID();
30 $obj_handle = id(new PhabricatorHandleQuery())
32 ->withPHIDs(array($obj_phid))
35 $title = pht('Raw Comment');
36 $body = $xaction->getComment()->getContent();
38 if ($request->getExists('email')) {
39 $content_source = $xaction->getContentSource();
40 $source_email = PhabricatorEmailContentSource
::SOURCECONST
;
41 if ($content_source->getSource() == $source_email) {
42 $source_id = $content_source->getContentSourceParameter('id');
44 $message = id(new PhabricatorMetaMTAReceivedMail())->loadOneWhere(
48 $title = pht('Email Body Text');
49 $body = $message->getRawTextBody();
51 'For full details, run `/bin/mail show-inbound --id %d`',
53 $addendum = new PHUIRemarkupView($viewer, $details_text);
58 $dialog = id(new AphrontDialogView())
60 ->addCancelButton($obj_handle->getURI())
64 ->addHiddenInput('anchor', $request->getStr('anchor'))
66 id(new PHUIFormLayoutView())
69 id(new AphrontFormTextAreaControl())
73 $dialog->appendParagraph($addendum);
76 return id(new AphrontDialogResponse())->setDialog($dialog);
79 public function shouldAllowPublic() {