mirror of
https://github.com/friendica/friendica
synced 2025-04-08 06:00:14 +00:00
32 lines
757 B
PHP
32 lines
757 B
PHP
<?php
|
|
|
|
// Copyright (C) 2010-2024, the Friendica project
|
|
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
namespace Friendica\Module\Api\Mastodon;
|
|
|
|
use Friendica\DI;
|
|
use Friendica\Module\BaseApi;
|
|
use Friendica\Network\HTTPException;
|
|
|
|
/**
|
|
* @see https://docs.joinmastodon.org/methods/statuses/polls/
|
|
*/
|
|
class Polls extends BaseApi
|
|
{
|
|
/**
|
|
* @throws HTTPException\InternalServerErrorException
|
|
*/
|
|
protected function rawContent(array $request = [])
|
|
{
|
|
$uid = self::getCurrentUserID();
|
|
|
|
if (empty($this->parameters['id'])) {
|
|
$this->logAndJsonError(422, $this->errorFactory->UnprocessableEntity());
|
|
}
|
|
|
|
$this->jsonExit(DI::mstdnPoll()->createFromId($this->parameters['id'], $uid));
|
|
}
|
|
}
|