Differential D21225 Diff 50550 src/applications/differential/conduit/DifferentialCreateCommentConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/conduit/DifferentialCreateCommentConduitAPIMethod.php
| Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | protected function execute(ConduitAPIRequest $request) { | ||||
| if (strlen($content)) { | if (strlen($content)) { | ||||
| $xactions[] = id(new DifferentialTransaction()) | $xactions[] = id(new DifferentialTransaction()) | ||||
| ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) | ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) | ||||
| ->attachComment( | ->attachComment( | ||||
| id(new DifferentialTransactionComment()) | id(new DifferentialTransactionComment()) | ||||
| ->setContent($content)); | ->setContent($content)); | ||||
| } | } | ||||
| if ($request->getValue('attach_inlines')) { | // NOTE: The legacy "attach_inlines" flag is now ignored and has no | ||||
| $type_inline = DifferentialTransaction::TYPE_INLINE; | // effect. See T13513. | ||||
| $inlines = DifferentialTransactionQuery::loadUnsubmittedInlineComments( | |||||
| $viewer, | |||||
| $revision); | |||||
| foreach ($inlines as $inline) { | |||||
| $xactions[] = id(new DifferentialTransaction()) | |||||
| ->setTransactionType($type_inline) | |||||
| ->attachComment($inline); | |||||
| } | |||||
| } | |||||
| // NOTE: The legacy "silent" flag is now ignored and has no effect. See | // NOTE: The legacy "silent" flag is now ignored and has no effect. See | ||||
| // T13042. | // T13042. | ||||
| $editor = id(new DifferentialTransactionEditor()) | $editor = id(new DifferentialTransactionEditor()) | ||||
| ->setActor($viewer) | ->setActor($viewer) | ||||
| ->setContentSource($request->newContentSource()) | ->setContentSource($request->newContentSource()) | ||||
| ->setContinueOnNoEffect(true) | ->setContinueOnNoEffect(true) | ||||
| Show All 11 Lines | |||||