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

Pholio - render inline comments together in an email

Summary: Used Differential emails as a formatting guide. This also includes "Image X: <inline comment>" similarly to how Differential has "<file path><line(s)>: <inline comment>" or what have you. Fixes T3138.

Test Plan: inserted some debugging code and verified the mail body format looked okay ish

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T3138

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

+43 -1
+43 -1
src/applications/pholio/editor/PholioMockEditor.php
··· 120 120 PhabricatorLiskDAO $object, 121 121 array $xactions) { 122 122 123 - $body = parent::buildMailBody($object, $xactions); 123 + $body = new PhabricatorMetaMTAMailBody(); 124 + $headers = array(); 125 + $comments = array(); 126 + $inline_comments = array(); 127 + 128 + foreach ($xactions as $xaction) { 129 + $comment = $xaction->getComment(); 130 + switch ($xaction->getTransactionType()) { 131 + case PholioTransactionType::TYPE_INLINE: 132 + if ($comment && strlen($comment->getContent())) { 133 + $inline_comments[] = $comment; 134 + } 135 + break; 136 + case PhabricatorTransactions::TYPE_COMMENT: 137 + if ($comment && strlen($comment->getContent())) { 138 + $comments[] = $comment->getContent(); 139 + } 140 + // fallthrough 141 + default: 142 + $headers[] = id(clone $xaction) 143 + ->setRenderingTarget('text') 144 + ->getTitle(); 145 + break; 146 + } 147 + } 148 + 149 + $body->addRawSection(implode("\n", $headers)); 150 + 151 + foreach ($comments as $comment) { 152 + $body->addRawSection($comment); 153 + } 154 + 155 + if ($inline_comments) { 156 + $body->addRawSection(pht('INLINE COMMENTS')); 157 + foreach ($inline_comments as $comment) { 158 + $text = pht( 159 + 'Image %d: %s', 160 + $comment->getImageID(), 161 + $comment->getContent()); 162 + $body->addRawSection($text); 163 + } 164 + } 165 + 124 166 $body->addTextSection( 125 167 pht('MOCK DETAIL'), 126 168 PhabricatorEnv::getProductionURI('/M'.$object->getID()));