Differential D7916 Diff 17918 src/applications/diffusion/conduit/ConduitAPI_diffusion_createcomment_Method.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/conduit/ConduitAPI_diffusion_createcomment_Method.php
Show All 15 Lines | return 'Add a comment to a Diffusion commit. By specifying an action of '. | ||||
'be triggered. Defaults to "comment".'; | 'be triggered. Defaults to "comment".'; | ||||
} | } | ||||
public function defineParamTypes() { | public function defineParamTypes() { | ||||
return array( | return array( | ||||
'phid' => 'required string', | 'phid' => 'required string', | ||||
'action' => 'optional string', | 'action' => 'optional string', | ||||
'message' => 'required string', | 'message' => 'required string', | ||||
'silent' => 'optional bool', | |||||
); | ); | ||||
} | } | ||||
public function defineReturnType() { | public function defineReturnType() { | ||||
return 'bool'; | return 'bool'; | ||||
} | } | ||||
public function defineErrorTypes() { | public function defineErrorTypes() { | ||||
Show All 36 Lines | protected function execute(ConduitAPIRequest $request) { | ||||
} | } | ||||
$comment = id(new PhabricatorAuditComment()) | $comment = id(new PhabricatorAuditComment()) | ||||
->setAction($action) | ->setAction($action) | ||||
->setContent($message); | ->setContent($message); | ||||
id(new PhabricatorAuditCommentEditor($commit)) | id(new PhabricatorAuditCommentEditor($commit)) | ||||
->setActor($request->getUser()) | ->setActor($request->getUser()) | ||||
->setNoEmail($request->getValue('silent')) | |||||
->addComment($comment); | ->addComment($comment); | ||||
return true; | return true; | ||||
// get the full uri of the comment? | // get the full uri of the comment? | ||||
// i.e, PhabricatorEnv::getURI(rXX01ab23cd#comment-9) | // i.e, PhabricatorEnv::getURI(rXX01ab23cd#comment-9) | ||||
} | } | ||||
} | } |