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

Make marking comments as "Done" work cleanly on EditEngine

Summary: Ref T11114. Fixes T10323.

Test Plan:
- Marked comments as done only: no warning about not leaving a comment.
- Did nothing: warning about posting an empty comment.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11114, T10323

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

+43
+25
src/applications/differential/editor/DifferentialRevisionEditEngine.php
··· 262 262 ->attachComment($inline); 263 263 } 264 264 265 + $viewer_phid = $viewer->getPHID(); 266 + $viewer_is_author = ($object->getAuthorPHID() == $viewer_phid); 267 + if ($viewer_is_author) { 268 + $state_map = PhabricatorTransactions::getInlineStateMap(); 269 + 270 + $inlines = id(new DifferentialDiffInlineCommentQuery()) 271 + ->setViewer($viewer) 272 + ->withRevisionPHIDs(array($object->getPHID())) 273 + ->withFixedStates(array_keys($state_map)) 274 + ->execute(); 275 + if ($inlines) { 276 + $old_value = mpull($inlines, 'getFixedState', 'getPHID'); 277 + $new_value = array(); 278 + foreach ($old_value as $key => $state) { 279 + $new_value[$key] = $state_map[$state]; 280 + } 281 + 282 + $xactions[] = id(new DifferentialTransaction()) 283 + ->setTransactionType(PhabricatorTransactions::TYPE_INLINESTATE) 284 + ->setIgnoreOnNoEffect(true) 285 + ->setOldValue($old_value) 286 + ->setNewValue($new_value); 287 + } 288 + } 289 + 265 290 return $xactions; 266 291 } 267 292
+18
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 58 58 $types[] = PhabricatorTransactions::TYPE_COMMENT; 59 59 $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; 60 60 $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY; 61 + $types[] = PhabricatorTransactions::TYPE_INLINESTATE; 61 62 62 63 $types[] = DifferentialTransaction::TYPE_ACTION; 63 64 $types[] = DifferentialTransaction::TYPE_INLINE; ··· 254 255 } 255 256 256 257 return parent::applyCustomInternalTransaction($object, $xaction); 258 + } 259 + 260 + protected function expandTransactions( 261 + PhabricatorLiskDAO $object, 262 + array $xactions) { 263 + 264 + // If we have an "Inline State" transaction already, the caller built it 265 + // for us so we don't need to expand it again. 266 + foreach ($xactions as $xaction) { 267 + switch ($xaction->getTransactionType()) { 268 + case PhabricatorTransactions::TYPE_INLINESTATE: 269 + $this->didExpandInlineState = true; 270 + break; 271 + } 272 + } 273 + 274 + return parent::expandTransactions($object, $xactions); 257 275 } 258 276 259 277 protected function expandTransaction(