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

Restore feed stories to Ponder

Summary: Ref T3578. These are a touch rough still, but work.

Test Plan: {F52154}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3578

Differential Revision: https://secure.phabricator.com/D6616

+99 -3
+1 -1
src/__celerity_resource_map__.php
··· 3920 3920 ), 3921 3921 'ponder-vote-css' => 3922 3922 array( 3923 - 'uri' => '/res/28b71b13/rsrc/css/application/ponder/vote.css', 3923 + 'uri' => '/res/6bbe8538/rsrc/css/application/ponder/vote.css', 3924 3924 'type' => 'css', 3925 3925 'requires' => 3926 3926 array(
+15
src/applications/phid/handle/PhabricatorObjectHandleData.php
··· 56 56 $xactions = array(); 57 57 foreach ($subtypes as $subtype => $subtype_phids) { 58 58 // TODO: Do this magically. 59 + // TODO: ^^^ Really do that ^^^ 59 60 switch ($subtype) { 61 + case PonderPHIDTypeQuestion::TYPECONST: 62 + $results = id(new PonderQuestionTransactionQuery()) 63 + ->setViewer($this->viewer) 64 + ->withPHIDs($subtype_phids) 65 + ->execute(); 66 + $xactions += mpull($results, null, 'getPHID'); 67 + break; 68 + case PonderPHIDTypeAnswer::TYPECONST: 69 + $results = id(new PonderAnswerTransactionQuery()) 70 + ->setViewer($this->viewer) 71 + ->withPHIDs($subtype_phids) 72 + ->execute(); 73 + $xactions += mpull($results, null, 'getPHID'); 74 + break; 60 75 case PholioPHIDTypeMock::TYPECONST: 61 76 $results = id(new PholioTransactionQuery()) 62 77 ->setViewer($this->viewer)
+8
src/applications/ponder/editor/PonderAnswerEditor.php
··· 62 62 return parent::mergeTransactions($u, $v); 63 63 } 64 64 65 + protected function supportsFeed() { 66 + return true; 67 + } 68 + 69 + protected function getMailTo(PhabricatorLiskDAO $object) { 70 + return array($object->getAuthorPHID()); 71 + } 72 + 65 73 66 74 }
+8 -1
src/applications/ponder/editor/PonderQuestionEditor.php
··· 145 145 return parent::mergeTransactions($u, $v); 146 146 } 147 147 148 - // TODO: Feed support 148 + protected function supportsFeed() { 149 + return true; 150 + } 151 + 152 + protected function getMailTo(PhabricatorLiskDAO $object) { 153 + return array($object->getAuthorPHID()); 154 + } 155 + 149 156 // TODO: Mail support 150 157 151 158 }
+18
src/applications/ponder/storage/PonderAnswerTransaction.php
··· 25 25 return pht('answer'); 26 26 } 27 27 28 + public function getTitleForFeed() { 29 + $author_phid = $this->getAuthorPHID(); 30 + $object_phid = $this->getObjectPHID(); 31 + 32 + $old = $this->getOldValue(); 33 + $new = $this->getNewValue(); 34 + 35 + switch ($this->getTransactionType()) { 36 + case self::TYPE_CONTENT: 37 + // TODO: This is not so good. 38 + return pht( 39 + '%s edited their answer to %s', 40 + $this->renderHandleLink($author_phid), 41 + $this->renderHandleLink($object_phid)); 42 + } 43 + 44 + return $this->getTitle(); 45 + } 28 46 29 47 } 30 48
+48
src/applications/ponder/storage/PonderQuestionTransaction.php
··· 134 134 return $view->render(); 135 135 } 136 136 137 + public function getTitleForFeed() { 138 + $author_phid = $this->getAuthorPHID(); 139 + $object_phid = $this->getObjectPHID(); 137 140 141 + $old = $this->getOldValue(); 142 + $new = $this->getNewValue(); 143 + 144 + switch ($this->getTransactionType()) { 145 + case self::TYPE_TITLE: 146 + if ($old === null) { 147 + return pht( 148 + '%s asked a question: %s', 149 + $this->renderHandleLink($author_phid), 150 + $this->renderHandleLink($object_phid)); 151 + } else { 152 + return pht( 153 + '%s edited the title of %s (was "%s")', 154 + $this->renderHandleLink($author_phid), 155 + $this->renderHandleLink($object_phid), 156 + $old); 157 + } 158 + case self::TYPE_CONTENT: 159 + return pht( 160 + '%s edited the description of %s', 161 + $this->renderHandleLink($author_phid), 162 + $this->renderHandleLink($object_phid)); 163 + case self::TYPE_ANSWERS: 164 + // TODO: This could be richer, too. 165 + return pht( 166 + '%s answered %s', 167 + $this->renderHandleLink($author_phid), 168 + $this->renderHandleLink($object_phid)); 169 + case self::TYPE_STATUS: 170 + switch ($new) { 171 + case PonderQuestionStatus::STATUS_OPEN: 172 + return pht( 173 + '%s reopened %s', 174 + $this->renderHandleLink($author_phid), 175 + $this->renderHandleLink($object_phid)); 176 + case PonderQuestionStatus::STATUS_CLOSED: 177 + return pht( 178 + '%s closed %s', 179 + $this->renderHandleLink($author_phid), 180 + $this->renderHandleLink($object_phid)); 181 + } 182 + } 183 + 184 + return $this->getTitle(); 185 + } 138 186 139 187 } 140 188
+1 -1
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 1307 1307 } 1308 1308 1309 1309 1310 - /* -( Custom Fields )------------------------------------------------------- */ 1310 + /* -( Custom Fields )------------------------------------------------------ */ 1311 1311 1312 1312 1313 1313 /**