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+class DifferentialCommentPreviewController extends DifferentialController {
2020+2121+ private $id;
2222+2323+ public function willProcessRequest(array $data) {
2424+ $this->id = $data['id'];
2525+ }
2626+2727+ public function processRequest() {
2828+2929+ $request = $this->getRequest();
3030+3131+ $author_phid = $request->getUser()->getPHID();
3232+3333+ $handles = id(new PhabricatorObjectHandleData(array($author_phid)))
3434+ ->loadHandles();
3535+3636+ $factory = new DifferentialMarkupEngineFactory();
3737+ $engine = $factory->newDifferentialCommentMarkupEngine();
3838+3939+ $comment = new DifferentialComment();
4040+ $comment->setContent($request->getStr('content'));
4141+ $comment->setAction($request->getStr('action'));
4242+ $comment->setAuthorPHID($author_phid);
4343+4444+ $view = new DifferentialRevisionCommentView();
4545+ $view->setComment($comment);
4646+ $view->setHandles($handles);
4747+ $view->setMarkupEngine($engine);
4848+ $view->setPreview(true);
4949+5050+ return id(new AphrontAjaxResponse())
5151+ ->setContent($view->render());
5252+ }
5353+5454+}