Add missing Twitter API routes for IDs
This commit is contained in:
parent
1d5206d594
commit
20934d73b0
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Twitter\Statuses;
|
namespace Friendica\Module\Api\Twitter\Statuses;
|
||||||
|
|
||||||
use Friendica\Content\Text\BBCode;
|
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -45,10 +44,12 @@ class Retweet extends BaseApi
|
||||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||||
$uid = self::getCurrentUserID();
|
$uid = self::getCurrentUserID();
|
||||||
|
|
||||||
$id = $request['id'] ?? 0;
|
if (!empty($this->parameters['id'])) {
|
||||||
|
$id = (int)$this->parameters['id'];
|
||||||
if (empty($id)) {
|
} elseif (!empty($request['id'])) {
|
||||||
throw new BadRequestException('Item id not specified');
|
$id = (int)$request['id'];
|
||||||
|
} else {
|
||||||
|
throw new BadRequestException('An id is missing.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = ['uri-id', 'network', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink'];
|
$fields = ['uri-id', 'network', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink'];
|
||||||
|
|
|
@ -120,6 +120,7 @@ $apiRoutes = [
|
||||||
|
|
||||||
'/statuses' => [
|
'/statuses' => [
|
||||||
'/destroy[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Destroy::class, [ R::POST]],
|
'/destroy[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Destroy::class, [ R::POST]],
|
||||||
|
'/destroy/{id:\d+}[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Destroy::class, [ R::POST]],
|
||||||
'/followers[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Followers\Lists::class, [R::GET ]],
|
'/followers[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Followers\Lists::class, [R::GET ]],
|
||||||
'/friends[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Friends\Lists::class, [R::GET ]],
|
'/friends[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Friends\Lists::class, [R::GET ]],
|
||||||
'/friends_timeline[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\HomeTimeline::class, [R::GET ]],
|
'/friends_timeline[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\HomeTimeline::class, [R::GET ]],
|
||||||
|
@ -131,6 +132,7 @@ $apiRoutes = [
|
||||||
'/public_timeline[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\PublicTimeline::class, [R::GET ]],
|
'/public_timeline[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\PublicTimeline::class, [R::GET ]],
|
||||||
'/replies[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Mentions::class, [R::GET ]],
|
'/replies[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Mentions::class, [R::GET ]],
|
||||||
'/retweet[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Retweet::class, [ R::POST]],
|
'/retweet[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Retweet::class, [ R::POST]],
|
||||||
|
'/retweet/{id:\d+}[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Retweet::class, [ R::POST]],
|
||||||
'/show[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Show::class, [R::GET ]],
|
'/show[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Show::class, [R::GET ]],
|
||||||
'/show/{id:\d+}[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Show::class, [R::GET ]],
|
'/show/{id:\d+}[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Show::class, [R::GET ]],
|
||||||
'/update[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Update::class, [ R::POST]],
|
'/update[.{extension:json|xml|rss|atom}]' => [Module\Api\Twitter\Statuses\Update::class, [ R::POST]],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user