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

at recaptime-dev/main 64 lines 1.8 kB view raw
1<?php 2 3final class PhabricatorSlowvoteCommentController 4 extends PhabricatorSlowvoteController { 5 6 public function handleRequest(AphrontRequest $request) { 7 $viewer = $request->getViewer(); 8 $id = $request->getURIData('id'); 9 10 if (!$request->isFormPost()) { 11 return new Aphront400Response(); 12 } 13 14 $poll = id(new PhabricatorSlowvoteQuery()) 15 ->setViewer($viewer) 16 ->withIDs(array($id)) 17 ->executeOne(); 18 if (!$poll) { 19 return new Aphront404Response(); 20 } 21 22 $is_preview = $request->isPreviewRequest(); 23 $draft = PhabricatorDraft::buildFromRequest($request); 24 25 $view_uri = '/V'.$poll->getID(); 26 27 $xactions = array(); 28 $xactions[] = id(new PhabricatorSlowvoteTransaction()) 29 ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) 30 ->attachComment( 31 id(new PhabricatorSlowvoteTransactionComment()) 32 ->setContent($request->getStr('comment'))); 33 34 $editor = id(new PhabricatorSlowvoteEditor()) 35 ->setActor($viewer) 36 ->setContinueOnNoEffect($request->isContinueRequest()) 37 ->setContentSourceFromRequest($request) 38 ->setIsPreview($is_preview); 39 40 try { 41 $xactions = $editor->applyTransactions($poll, $xactions); 42 } catch (PhabricatorApplicationTransactionNoEffectException $ex) { 43 return id(new PhabricatorApplicationTransactionNoEffectResponse()) 44 ->setCancelURI($view_uri) 45 ->setException($ex); 46 } 47 48 if ($draft) { 49 $draft->replaceOrDelete(); 50 } 51 52 if ($request->isAjax() && $is_preview) { 53 return id(new PhabricatorApplicationTransactionResponse()) 54 ->setObject($poll) 55 ->setViewer($viewer) 56 ->setTransactions($xactions) 57 ->setIsPreview($is_preview); 58 } else { 59 return id(new AphrontRedirectResponse()) 60 ->setURI($view_uri); 61 } 62 } 63 64}