mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 14:00:56 +01:00
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
This commit is contained in:
parent
698ada2470
commit
431612023d
2 changed files with 0 additions and 51 deletions
|
@ -1294,7 +1294,6 @@ phutil_register_library_map(array(
|
|||
'DrydockWorkingCopyBlueprintImplementation' => 'applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php',
|
||||
'EdgeSearchConduitAPIMethod' => 'infrastructure/edges/conduit/EdgeSearchConduitAPIMethod.php',
|
||||
'FeedConduitAPIMethod' => 'applications/feed/conduit/FeedConduitAPIMethod.php',
|
||||
'FeedPublishConduitAPIMethod' => 'applications/feed/conduit/FeedPublishConduitAPIMethod.php',
|
||||
'FeedPublisherHTTPWorker' => 'applications/feed/worker/FeedPublisherHTTPWorker.php',
|
||||
'FeedPublisherWorker' => 'applications/feed/worker/FeedPublisherWorker.php',
|
||||
'FeedPushWorker' => 'applications/feed/worker/FeedPushWorker.php',
|
||||
|
@ -7371,7 +7370,6 @@ phutil_register_library_map(array(
|
|||
'DrydockWorkingCopyBlueprintImplementation' => 'DrydockBlueprintImplementation',
|
||||
'EdgeSearchConduitAPIMethod' => 'ConduitAPIMethod',
|
||||
'FeedConduitAPIMethod' => 'ConduitAPIMethod',
|
||||
'FeedPublishConduitAPIMethod' => 'FeedConduitAPIMethod',
|
||||
'FeedPublisherHTTPWorker' => 'FeedPushWorker',
|
||||
'FeedPublisherWorker' => 'FeedPushWorker',
|
||||
'FeedPushWorker' => 'PhabricatorWorker',
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class FeedPublishConduitAPIMethod extends FeedConduitAPIMethod {
|
||||
|
||||
public function getAPIMethodName() {
|
||||
return 'feed.publish';
|
||||
}
|
||||
|
||||
public function getMethodStatus() {
|
||||
return self::METHOD_STATUS_UNSTABLE;
|
||||
}
|
||||
|
||||
public function getMethodDescription() {
|
||||
return pht('Publish a story to the feed.');
|
||||
}
|
||||
|
||||
protected function defineParamTypes() {
|
||||
return array(
|
||||
'type' => 'required string',
|
||||
'data' => 'required dict',
|
||||
'time' => 'optional int',
|
||||
);
|
||||
}
|
||||
|
||||
protected function defineReturnType() {
|
||||
return 'nonempty phid';
|
||||
}
|
||||
|
||||
protected function execute(ConduitAPIRequest $request) {
|
||||
$type = $request->getValue('type');
|
||||
$data = $request->getValue('data');
|
||||
$time = $request->getValue('time');
|
||||
|
||||
$author_phid = $request->getUser()->getPHID();
|
||||
$phids = array($author_phid);
|
||||
|
||||
$publisher = new PhabricatorFeedStoryPublisher();
|
||||
$publisher->setStoryType($type);
|
||||
$publisher->setStoryData($data);
|
||||
$publisher->setStoryTime($time);
|
||||
$publisher->setRelatedPHIDs($phids);
|
||||
$publisher->setStoryAuthorPHID($author_phid);
|
||||
|
||||
$data = $publisher->publish();
|
||||
|
||||
return $data->getPHID();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue