Select the types of activity you want to include in your feed.
@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
···11+<?php
22+33+/*
44+ * Copyright 2011 Facebook, Inc.
55+ *
66+ * Licensed under the Apache License, Version 2.0 (the "License");
77+ * you may not use this file except in compliance with the License.
88+ * You may obtain a copy of the License at
99+ *
1010+ * http://www.apache.org/licenses/LICENSE-2.0
1111+ *
1212+ * Unless required by applicable law or agreed to in writing, software
1313+ * distributed under the License is distributed on an "AS IS" BASIS,
1414+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515+ * See the License for the specific language governing permissions and
1616+ * limitations under the License.
1717+ */
1818+1919+/**
2020+ * @group aphront
2121+ */
2222+class Aphront400Response extends AphrontResponse {
2323+2424+ public function buildResponseString() {
2525+ return '400 Bad Request';
2626+ }
2727+2828+}
+12
src/aphront/response/400/__init__.php
···11+<?php
22+/**
33+ * This file is automatically generated. Lint this module to rebuild it.
44+ * @generated
55+ */
66+77+88+99+phutil_require_module('phabricator', 'aphront/response/base');
1010+1111+1212+phutil_require_source('Aphront400Response.php');
···11+<?php
22+33+/*
44+ * Copyright 2011 Facebook, Inc.
55+ *
66+ * Licensed under the Apache License, Version 2.0 (the "License");
77+ * you may not use this file except in compliance with the License.
88+ * You may obtain a copy of the License at
99+ *
1010+ * http://www.apache.org/licenses/LICENSE-2.0
1111+ *
1212+ * Unless required by applicable law or agreed to in writing, software
1313+ * distributed under the License is distributed on an "AS IS" BASIS,
1414+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515+ * See the License for the specific language governing permissions and
1616+ * limitations under the License.
1717+ */
1818+1919+class DifferentialCommentSaveController extends DifferentialController {
2020+2121+ public function processRequest() {
2222+ $request = $this->getRequest();
2323+ if (!$request->isFormPost()) {
2424+ return new Aphront400Response();
2525+ }
2626+2727+ $revision_id = $request->getInt('revision_id');
2828+ $revision = id(new DifferentialRevision())->load($revision_id);
2929+ if (!$revision) {
3030+ return new Aphront400Response();
3131+ }
3232+3333+ $comment = $request->getStr('comment');
3434+ $action = $request->getStr('action');
3535+ $reviewers = $request->getStr('reviewers');
3636+3737+ $editor = new DifferentialCommentEditor(
3838+ $revision,
3939+ $request->getUser()->getPHID(),
4040+ $action);
4141+4242+ $editor
4343+ ->setMessage($comment)
4444+ ->setAttachInlineComments(true)
4545+ ->setAddCC($action != DifferentialAction::ACTION_RESIGN)
4646+ ->setAddedReviewers($reviewers)
4747+ ->save();
4848+4949+ // TODO: Diff change detection?
5050+ // TODO: Clear draft
5151+5252+ return id(new AphrontRedirectResponse())
5353+ ->setURI('/D'.$revision->getID());
5454+ }
5555+5656+}