namespace Friendica\Module\Api\Twitter\Statuses;
-use Friendica\Content\Text\BBCode;
use Friendica\Core\Protocol;
use Friendica\Database\DBA;
use Friendica\DI;
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
- $id = $request['id'] ?? 0;
-
- if (empty($id)) {
- throw new BadRequestException('Item id not specified');
+ if (!empty($this->parameters['id'])) {
+ $id = (int)$this->parameters['id'];
+ } elseif (!empty($request['id'])) {
+ $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'];
'/statuses' => [
'/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 ]],
'/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 ]],
'/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 ]],
'/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/{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]],