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

Differential - re-jigger mail such that inline comments show up right after the main comments.

Summary: Ref T6962. Mainly accomplished by re-factoring the base editor `buildMailBody` function and then using it differently in the `DifferentialTransactionEditor`.

Test Plan: commented on a revision leaving inline feedback. inspected via bin/mail and it looked good! also made a maniphest comment and checked that email, which still looked good.

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6962

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

+36 -11
+11 -6
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 1137 1137 PhabricatorLiskDAO $object, 1138 1138 array $xactions) { 1139 1139 1140 - $body = parent::buildMailBody($object, $xactions); 1140 + $body = new PhabricatorMetaMTAMailBody(); 1141 + $body->setViewer($this->requireActor()); 1142 + 1143 + $this->addHeadersAndCommentsToMailBody($body, $xactions); 1141 1144 1142 1145 $type_inline = DifferentialTransaction::TYPE_INLINE; 1143 1146 ··· 1148 1151 } 1149 1152 } 1150 1153 1154 + if ($inlines) { 1155 + $body->addTextSection( 1156 + pht('INLINE COMMENTS'), 1157 + $this->renderInlineCommentsForMail($object, $inlines)); 1158 + } 1159 + 1151 1160 $changed_uri = $this->getChangedPriorToCommitURI(); 1152 1161 if ($changed_uri) { 1153 1162 $body->addLinkSection( ··· 1155 1164 $changed_uri); 1156 1165 } 1157 1166 1158 - if ($inlines) { 1159 - $body->addTextSection( 1160 - pht('INLINE COMMENTS'), 1161 - $this->renderInlineCommentsForMail($object, $inlines)); 1162 - } 1167 + $this->addCustomFieldsToMailBody($body, $object, $xactions); 1163 1168 1164 1169 $body->addLinkSection( 1165 1170 pht('REVISION DETAIL'),
+25 -5
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 2191 2191 PhabricatorLiskDAO $object, 2192 2192 array $xactions) { 2193 2193 2194 + $body = new PhabricatorMetaMTAMailBody(); 2195 + $body->setViewer($this->requireActor()); 2196 + 2197 + $this->addHeadersAndCommentsToMailBody($body, $xactions); 2198 + $this->addCustomFieldsToMailBody($body, $object, $xactions); 2199 + return $body; 2200 + } 2201 + 2202 + /** 2203 + * @task mail 2204 + */ 2205 + protected function addHeadersAndCommentsToMailBody( 2206 + PhabricatorMetaMTAMailBody $body, 2207 + array $xactions) { 2208 + 2194 2209 $headers = array(); 2195 2210 $comments = array(); 2196 2211 ··· 2209 2224 $comments[] = $comment; 2210 2225 } 2211 2226 } 2212 - 2213 - $body = new PhabricatorMetaMTAMailBody(); 2214 - $body->setViewer($this->requireActor()); 2215 2227 $body->addRawSection(implode("\n", $headers)); 2216 2228 2217 2229 foreach ($comments as $comment) { 2218 2230 $body->addRemarkupSection($comment); 2219 2231 } 2232 + } 2233 + 2234 + /** 2235 + * @task mail 2236 + */ 2237 + protected function addCustomFieldsToMailBody( 2238 + PhabricatorMetaMTAMailBody $body, 2239 + PhabricatorLiskDAO $object, 2240 + array $xactions) { 2220 2241 2221 2242 if ($object instanceof PhabricatorCustomFieldInterface) { 2222 2243 $field_list = PhabricatorCustomField::getObjectFields( ··· 2232 2253 $xactions); 2233 2254 } 2234 2255 } 2256 + } 2235 2257 2236 - return $body; 2237 - } 2238 2258 2239 2259 2240 2260 /* -( Publishing Feed Stories )-------------------------------------------- */