@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.

Add "View Email" action to application transactions

Summary: Should help with debugging. In the web UI there is now a link to "View Email". This uses the same debugging output that `./bin/mail show-outbound` uses. Fixes T5768. Code is very defensive as I think these tables may be truncated eventually?

Test Plan: viewed some emails and it worked!

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5768

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

+48 -2
+31 -2
src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php
··· 38 38 ->withPHIDs(array($obj_phid)) 39 39 ->executeOne(); 40 40 41 + $title = pht('Raw Comment'); 42 + $body = $xaction->getComment()->getContent(); 43 + $addendum = null; 44 + if ($request->getExists('email')) { 45 + $content_source = $xaction->getContentSource(); 46 + $source_email = PhabricatorContentSource::SOURCE_EMAIL; 47 + if ($content_source->getSource() == $source_email) { 48 + $source_id = $content_source->getParam('id'); 49 + if ($source_id) { 50 + $message = id(new PhabricatorMetaMTAReceivedMail())->loadOneWhere( 51 + 'id = %d', 52 + $source_id); 53 + if ($message) { 54 + $title = pht('Email Body Text'); 55 + $body = $message->getRawTextBody(); 56 + $details_text = pht( 57 + 'For full details, run `/bin/mail show-outbound --id %d`', 58 + $source_id); 59 + $addendum = PhabricatorMarkupEngine::renderOneObject( 60 + id(new PhabricatorMarkupOneOff())->setContent($details_text), 61 + 'default', 62 + $user); 63 + } 64 + } 65 + } 66 + } 41 67 $dialog = id(new AphrontDialogView()) 42 68 ->setUser($user) 43 69 ->addCancelButton($obj_handle->getURI()) 44 - ->setTitle(pht('Raw Comment')); 70 + ->setTitle($title); 45 71 46 72 $dialog 47 73 ->addHiddenInput('anchor', $request->getStr('anchor')) ··· 51 77 ->appendChild( 52 78 id(new AphrontFormTextAreaControl()) 53 79 ->setReadOnly(true) 54 - ->setValue($xaction->getComment()->getContent()))); 80 + ->setValue($body))); 81 + if ($addendum) { 82 + $dialog->appendParagraph($addendum); 83 + } 55 84 56 85 return id(new AphrontDialogResponse())->setDialog($dialog); 57 86 }
+17
src/view/phui/PHUITimelineEventView.php
··· 539 539 array( 540 540 'anchor' => $anchor, 541 541 )); 542 + 543 + $content_source = $this->getContentSource(); 544 + $source_email = PhabricatorContentSource::SOURCE_EMAIL; 545 + if ($content_source->getSource() == $source_email) { 546 + $source_id = $content_source->getParam('id'); 547 + if ($source_id) { 548 + $items[] = id(new PhabricatorActionView()) 549 + ->setIcon('fa-envelope-o') 550 + ->setHref('/transactions/raw/'.$xaction_phid.'/?email') 551 + ->setName(pht('View Email Body')) 552 + ->addSigil('transaction-raw') 553 + ->setMetadata( 554 + array( 555 + 'anchor' => $anchor, 556 + )); 557 + } 558 + } 542 559 } 543 560 544 561 if ($this->getIsRemovable()) {