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

Remove "feed.publish" API

Summary:
Ref T13681. This was introduced in D593, never used, and doesn't make sense or have any uses in modern Phabricator.

It also does some pretty direct writes that can technically do things that at least //look// like they violate policies, so remove it.

Test Plan:
- Checked the API console, no longer saw "feed.publish".
- Grepped for "feed.publish", no hits.

Maniphest Tasks: T13681

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

-51
-2
src/__phutil_library_map__.php
··· 1294 1294 'DrydockWorkingCopyBlueprintImplementation' => 'applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php', 1295 1295 'EdgeSearchConduitAPIMethod' => 'infrastructure/edges/conduit/EdgeSearchConduitAPIMethod.php', 1296 1296 'FeedConduitAPIMethod' => 'applications/feed/conduit/FeedConduitAPIMethod.php', 1297 - 'FeedPublishConduitAPIMethod' => 'applications/feed/conduit/FeedPublishConduitAPIMethod.php', 1298 1297 'FeedPublisherHTTPWorker' => 'applications/feed/worker/FeedPublisherHTTPWorker.php', 1299 1298 'FeedPublisherWorker' => 'applications/feed/worker/FeedPublisherWorker.php', 1300 1299 'FeedPushWorker' => 'applications/feed/worker/FeedPushWorker.php', ··· 7371 7370 'DrydockWorkingCopyBlueprintImplementation' => 'DrydockBlueprintImplementation', 7372 7371 'EdgeSearchConduitAPIMethod' => 'ConduitAPIMethod', 7373 7372 'FeedConduitAPIMethod' => 'ConduitAPIMethod', 7374 - 'FeedPublishConduitAPIMethod' => 'FeedConduitAPIMethod', 7375 7373 'FeedPublisherHTTPWorker' => 'FeedPushWorker', 7376 7374 'FeedPublisherWorker' => 'FeedPushWorker', 7377 7375 'FeedPushWorker' => 'PhabricatorWorker',
-49
src/applications/feed/conduit/FeedPublishConduitAPIMethod.php
··· 1 - <?php 2 - 3 - final class FeedPublishConduitAPIMethod extends FeedConduitAPIMethod { 4 - 5 - public function getAPIMethodName() { 6 - return 'feed.publish'; 7 - } 8 - 9 - public function getMethodStatus() { 10 - return self::METHOD_STATUS_UNSTABLE; 11 - } 12 - 13 - public function getMethodDescription() { 14 - return pht('Publish a story to the feed.'); 15 - } 16 - 17 - protected function defineParamTypes() { 18 - return array( 19 - 'type' => 'required string', 20 - 'data' => 'required dict', 21 - 'time' => 'optional int', 22 - ); 23 - } 24 - 25 - protected function defineReturnType() { 26 - return 'nonempty phid'; 27 - } 28 - 29 - protected function execute(ConduitAPIRequest $request) { 30 - $type = $request->getValue('type'); 31 - $data = $request->getValue('data'); 32 - $time = $request->getValue('time'); 33 - 34 - $author_phid = $request->getUser()->getPHID(); 35 - $phids = array($author_phid); 36 - 37 - $publisher = new PhabricatorFeedStoryPublisher(); 38 - $publisher->setStoryType($type); 39 - $publisher->setStoryData($data); 40 - $publisher->setStoryTime($time); 41 - $publisher->setRelatedPHIDs($phids); 42 - $publisher->setStoryAuthorPHID($author_phid); 43 - 44 - $data = $publisher->publish(); 45 - 46 - return $data->getPHID(); 47 - } 48 - 49 - }