Update PHPDoc in include/
This commit is contained in:
parent
d1c6ec9718
commit
c5cb976b62
331
include/api.php
331
include/api.php
|
@ -87,6 +87,7 @@ function api_user()
|
|||
*
|
||||
* @return string
|
||||
* Client source name, default to "api" if unset/unknown
|
||||
* @throws Exception
|
||||
*/
|
||||
function api_source()
|
||||
{
|
||||
|
@ -113,6 +114,7 @@ function api_source()
|
|||
*
|
||||
* @param string $str Source date, as UTC
|
||||
* @return string Date in UTC formatted as "D M d H:i:s +0000 Y"
|
||||
* @throws Exception
|
||||
*/
|
||||
function api_date($str)
|
||||
{
|
||||
|
@ -158,7 +160,9 @@ function api_register_func($path, $func, $auth = false, $method = API_METHOD_ANY
|
|||
*
|
||||
* @brief Login API user
|
||||
*
|
||||
* @param object $a App
|
||||
* @param App $a App
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @hook 'authenticate'
|
||||
* array $addon_auth
|
||||
* 'username' => username from login form
|
||||
|
@ -276,8 +280,9 @@ function api_check_method($method)
|
|||
*
|
||||
* @brief Main API entry point
|
||||
*
|
||||
* @param object $a App
|
||||
* @param App $a App
|
||||
* @return string|array API call result
|
||||
* @throws Exception
|
||||
*/
|
||||
function api_call(App $a)
|
||||
{
|
||||
|
@ -472,6 +477,10 @@ function api_error($type, $e)
|
|||
* @param array $arr Array to be passed to template
|
||||
* @param array $user_info User info
|
||||
* @return array
|
||||
* @throws BadRequestException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @todo find proper type-hints
|
||||
*/
|
||||
function api_rss_extra(App $a, $arr, $user_info)
|
||||
|
@ -501,6 +510,7 @@ function api_rss_extra(App $a, $arr, $user_info)
|
|||
* @param int $id Contact id
|
||||
* @return bool|string
|
||||
* Contact url or False if contact id is unknown
|
||||
* @throws Exception
|
||||
*/
|
||||
function api_unique_id_to_nurl($id)
|
||||
{
|
||||
|
@ -516,8 +526,13 @@ function api_unique_id_to_nurl($id)
|
|||
/**
|
||||
* @brief Get user info array.
|
||||
*
|
||||
* @param object $a App
|
||||
* @param App $a App
|
||||
* @param int|string $contact_id Contact ID or URL
|
||||
* @return array
|
||||
* @throws BadRequestException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_get_user(App $a, $contact_id = null)
|
||||
{
|
||||
|
@ -810,9 +825,13 @@ function api_get_user(App $a, $contact_id = null)
|
|||
/**
|
||||
* @brief return api-formatted array for item's author and owner
|
||||
*
|
||||
* @param object $a App
|
||||
* @param App $a App
|
||||
* @param array $item item from db
|
||||
* @return array(array:author, array:owner)
|
||||
* @throws BadRequestException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_item_get_user(App $a, $item)
|
||||
{
|
||||
|
@ -833,7 +852,7 @@ function api_item_get_user(App $a, $item)
|
|||
* @brief walks recursively through an array with the possibility to change value and key
|
||||
*
|
||||
* @param array $array The array to walk through
|
||||
* @param string $callback The callback function
|
||||
* @param callable $callback The callback function
|
||||
*
|
||||
* @return array the transformed array
|
||||
*/
|
||||
|
@ -935,7 +954,7 @@ function api_create_xml(array $data, $root_element)
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
* @param array $data JSON style array
|
||||
*
|
||||
* @return (string|array) XML data or JSON data
|
||||
* @return array|string (string|array) XML data or JSON data
|
||||
*/
|
||||
function api_format_data($root_element, $type, $data)
|
||||
{
|
||||
|
@ -960,9 +979,16 @@ function api_format_data($root_element, $type, $data)
|
|||
/**
|
||||
* Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful;
|
||||
* returns a 401 status code and an error message if not.
|
||||
*
|
||||
* @see https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials
|
||||
*
|
||||
* @param string $type Return type (atom, rss, xml, json)
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_account_verify_credentials($type)
|
||||
{
|
||||
|
@ -1010,6 +1036,7 @@ api_register_func('api/account/verify_credentials', 'api_account_verify_credenti
|
|||
* Get data from $_POST or $_GET
|
||||
*
|
||||
* @param string $k
|
||||
* @return null
|
||||
*/
|
||||
function requestdata($k)
|
||||
{
|
||||
|
@ -1028,6 +1055,11 @@ function requestdata($k)
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_statuses_mediap($type)
|
||||
{
|
||||
|
@ -1075,6 +1107,12 @@ api_register_func('api/statuses/mediap', 'api_statuses_mediap', true, API_METHOD
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws TooManyRequestsException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update
|
||||
*/
|
||||
function api_statuses_update($type)
|
||||
|
@ -1217,6 +1255,11 @@ api_register_func('api/statuses/update_with_media', 'api_statuses_update', true,
|
|||
* Uploads an image to Friendica.
|
||||
*
|
||||
* @return array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-upload
|
||||
*/
|
||||
function api_media_upload()
|
||||
|
@ -1262,7 +1305,12 @@ api_register_func('api/media/upload', 'api_media_upload', true, API_METHOD_POST)
|
|||
*
|
||||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @param int $item_id
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_status_show($type, $item_id = 0)
|
||||
{
|
||||
|
@ -1361,6 +1409,11 @@ function api_status_show($type, $item_id = 0)
|
|||
* The author's most recent status will be returned inline.
|
||||
*
|
||||
* @param string $type Return type (atom, rss, xml, json)
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-show
|
||||
*/
|
||||
function api_users_show($type)
|
||||
|
@ -1437,6 +1490,10 @@ api_register_func('api/externalprofile/show', 'api_users_show');
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-search
|
||||
*/
|
||||
function api_users_search($type)
|
||||
|
@ -1485,7 +1542,11 @@ api_register_func('api/users/search', 'api_users_search');
|
|||
* @param string $type Return format: json or xml
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws NotFoundException if the results are empty.
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_users_lookup($type)
|
||||
{
|
||||
|
@ -1518,6 +1579,10 @@ api_register_func('api/users/lookup', 'api_users_lookup', true);
|
|||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException if the "q" parameter is missing.
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_search($type)
|
||||
{
|
||||
|
@ -1604,6 +1669,12 @@ api_register_func('api/search', 'api_search', true);
|
|||
*
|
||||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @todo Optional parameters
|
||||
* @todo Add reply info
|
||||
*/
|
||||
|
@ -1697,6 +1768,11 @@ api_register_func('api/statuses/friends_timeline', 'api_statuses_home_timeline',
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_statuses_public_timeline($type)
|
||||
{
|
||||
|
@ -1780,7 +1856,11 @@ api_register_func('api/statuses/public_timeline', 'api_statuses_public_timeline'
|
|||
*
|
||||
* @param string $type Return format: json, xml, atom, rss
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_statuses_networkpublic_timeline($type)
|
||||
{
|
||||
|
@ -1837,6 +1917,12 @@ api_register_func('api/statuses/networkpublic_timeline', 'api_statuses_networkpu
|
|||
*
|
||||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-show-id
|
||||
*/
|
||||
function api_statuses_show($type)
|
||||
|
@ -1910,6 +1996,12 @@ api_register_func('api/statuses/show', 'api_statuses_show', true);
|
|||
*
|
||||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @todo nothing to say?
|
||||
*/
|
||||
function api_conversation_show($type)
|
||||
|
@ -1987,6 +2079,12 @@ api_register_func('api/statusnet/conversation', 'api_conversation_show', true);
|
|||
*
|
||||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-retweet-id
|
||||
*/
|
||||
function api_statuses_repeat($type)
|
||||
|
@ -2054,6 +2152,12 @@ api_register_func('api/statuses/retweet', 'api_statuses_repeat', true, API_METHO
|
|||
*
|
||||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-destroy-id
|
||||
*/
|
||||
function api_statuses_destroy($type)
|
||||
|
@ -2095,6 +2199,12 @@ api_register_func('api/statuses/destroy', 'api_statuses_destroy', true, API_METH
|
|||
*
|
||||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see http://developer.twitter.com/doc/get/statuses/mentions
|
||||
*/
|
||||
function api_statuses_mentions($type)
|
||||
|
@ -2162,7 +2272,11 @@ api_register_func('api/statuses/replies', 'api_statuses_mentions', true);
|
|||
*
|
||||
* @param string $type Either "json" or "xml"
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-user_timeline
|
||||
*/
|
||||
function api_statuses_user_timeline($type)
|
||||
|
@ -2243,6 +2357,12 @@ api_register_func('api/statuses/user_timeline', 'api_statuses_user_timeline', tr
|
|||
*
|
||||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://web.archive.org/web/20131019055350/https://dev.twitter.com/docs/api/1/post/favorites/create/%3Aid
|
||||
*/
|
||||
function api_favorites_create_destroy($type)
|
||||
|
@ -2320,6 +2440,11 @@ api_register_func('api/favorites/destroy', 'api_favorites_create_destroy', true,
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_favorites($type)
|
||||
{
|
||||
|
@ -2391,6 +2516,7 @@ api_register_func('api/favorites', 'api_favorites', true);
|
|||
* @param array $sender
|
||||
*
|
||||
* @return array
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_format_messages($item, $recipient, $sender)
|
||||
{
|
||||
|
@ -2448,6 +2574,7 @@ function api_format_messages($item, $recipient, $sender)
|
|||
* @param array $item
|
||||
*
|
||||
* @return array
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_convert_item($item)
|
||||
{
|
||||
|
@ -2523,6 +2650,7 @@ function api_convert_item($item)
|
|||
* @param string $body
|
||||
*
|
||||
* @return array
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_get_attachments(&$body)
|
||||
{
|
||||
|
@ -2561,6 +2689,7 @@ function api_get_attachments(&$body)
|
|||
* @param string $bbcode
|
||||
*
|
||||
* @return array
|
||||
* @throws InternalServerErrorException
|
||||
* @todo Links at the first character of the post
|
||||
*/
|
||||
function api_get_entitities(&$text, $bbcode)
|
||||
|
@ -2777,6 +2906,10 @@ function api_contactlink_to_array($txt)
|
|||
* @return array
|
||||
* likes => int count,
|
||||
* dislikes => int count
|
||||
* @throws BadRequestException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_format_items_activities($item, $type = "json")
|
||||
{
|
||||
|
@ -2845,6 +2978,7 @@ function api_format_items_activities($item, $type = "json")
|
|||
*
|
||||
* @param array $profile_row array containing data from db table 'profile'
|
||||
* @return array
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_format_items_profiles($profile_row)
|
||||
{
|
||||
|
@ -2899,6 +3033,11 @@ function api_format_items_profiles($profile_row)
|
|||
* @param array $user_info
|
||||
* @param bool $filter_user filter items by $user_info
|
||||
* @param string $type Return type (atom, rss, xml, json)
|
||||
* @return array
|
||||
* @throws BadRequestException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_format_items($r, $user_info, $filter_user = false, $type = "json")
|
||||
{
|
||||
|
@ -3013,6 +3152,7 @@ function api_format_items($r, $user_info, $filter_user = false, $type = "json")
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws Exception
|
||||
*/
|
||||
function api_account_rate_limit_status($type)
|
||||
{
|
||||
|
@ -3088,6 +3228,11 @@ api_register_func('api/lists/subscriptions', 'api_lists_list', true);
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-ownerships
|
||||
*/
|
||||
function api_lists_ownerships($type)
|
||||
|
@ -3132,6 +3277,11 @@ api_register_func('api/lists/ownerships', 'api_lists_ownerships', true);
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/get-lists-ownerships
|
||||
*/
|
||||
function api_lists_statuses($type)
|
||||
|
@ -3209,7 +3359,11 @@ api_register_func('api/lists/statuses', 'api_lists_statuses', true);
|
|||
*
|
||||
* @param string $qtype Either "friends" or "followers"
|
||||
* @return boolean|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_statuses_f($qtype)
|
||||
{
|
||||
|
@ -3299,6 +3453,8 @@ function api_statuses_f($qtype)
|
|||
*
|
||||
* @param string $type Either "json" or "xml"
|
||||
* @return boolean|string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
*/
|
||||
function api_statuses_friends($type)
|
||||
{
|
||||
|
@ -3318,6 +3474,8 @@ function api_statuses_friends($type)
|
|||
*
|
||||
* @param string $type Either "json" or "xml"
|
||||
* @return boolean|string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
*/
|
||||
function api_statuses_followers($type)
|
||||
{
|
||||
|
@ -3340,6 +3498,8 @@ api_register_func('api/statuses/followers', 'api_statuses_followers', true);
|
|||
* @param string $type Either "json" or "xml"
|
||||
*
|
||||
* @return boolean|string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
*/
|
||||
function api_blocks_list($type)
|
||||
{
|
||||
|
@ -3361,6 +3521,8 @@ api_register_func('api/blocks/list', 'api_blocks_list', true);
|
|||
* @param string $type Either "json" or "xml"
|
||||
*
|
||||
* @return boolean|string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
*/
|
||||
function api_friendships_incoming($type)
|
||||
{
|
||||
|
@ -3386,6 +3548,7 @@ api_register_func('api/friendships/incoming', 'api_friendships_incoming', true);
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_statusnet_config($type)
|
||||
{
|
||||
|
@ -3445,6 +3608,12 @@ api_register_func('api/statusnet/version', 'api_statusnet_version', false);
|
|||
*
|
||||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string|void
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @todo use api_format_data() to return data
|
||||
*/
|
||||
function api_ff_ids($type)
|
||||
|
@ -3487,6 +3656,8 @@ function api_ff_ids($type)
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @see https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friends-ids
|
||||
*/
|
||||
function api_friends_ids($type)
|
||||
|
@ -3500,6 +3671,8 @@ function api_friends_ids($type)
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @see https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids
|
||||
*/
|
||||
function api_followers_ids($type)
|
||||
|
@ -3517,6 +3690,12 @@ api_register_func('api/followers/ids', 'api_followers_ids', true);
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws NotFoundException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/new-message
|
||||
*/
|
||||
function api_direct_messages_new($type)
|
||||
|
@ -3605,6 +3784,11 @@ api_register_func('api/direct_messages/new', 'api_direct_messages_new', true, AP
|
|||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/delete-message
|
||||
*/
|
||||
function api_direct_messages_destroy($type)
|
||||
|
@ -3686,6 +3870,11 @@ api_register_func('api/direct_messages/destroy', 'api_direct_messages_destroy',
|
|||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws NotFoundException
|
||||
* @see https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/post-friendships-destroy.html
|
||||
*/
|
||||
function api_friendships_destroy($type)
|
||||
|
@ -3764,6 +3953,11 @@ api_register_func('api/friendships/destroy', 'api_friendships_destroy', true, AP
|
|||
* @param string $verbose
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_direct_messages_box($type, $box, $verbose)
|
||||
{
|
||||
|
@ -3869,6 +4063,8 @@ function api_direct_messages_box($type, $box, $verbose)
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @see https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/get-sent-message
|
||||
*/
|
||||
function api_direct_messages_sentbox($type)
|
||||
|
@ -3883,6 +4079,8 @@ function api_direct_messages_sentbox($type)
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @see https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/get-messages
|
||||
*/
|
||||
function api_direct_messages_inbox($type)
|
||||
|
@ -3896,6 +4094,8 @@ function api_direct_messages_inbox($type)
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
*/
|
||||
function api_direct_messages_all($type)
|
||||
{
|
||||
|
@ -3908,6 +4108,8 @@ function api_direct_messages_all($type)
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
*/
|
||||
function api_direct_messages_conversation($type)
|
||||
{
|
||||
|
@ -3968,6 +4170,9 @@ api_register_func('api/oauth/access_token', 'api_oauth_access_token', false);
|
|||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_fr_photoalbum_delete($type)
|
||||
{
|
||||
|
@ -4020,6 +4225,9 @@ function api_fr_photoalbum_delete($type)
|
|||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_fr_photoalbum_update($type)
|
||||
{
|
||||
|
@ -4059,6 +4267,8 @@ function api_fr_photoalbum_update($type)
|
|||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
* @return string|array
|
||||
* @throws ForbiddenException
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_fr_photos_list($type)
|
||||
{
|
||||
|
@ -4105,6 +4315,11 @@ function api_fr_photos_list($type)
|
|||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws NotFoundException
|
||||
*/
|
||||
function api_fr_photo_create_update($type)
|
||||
{
|
||||
|
@ -4239,6 +4454,9 @@ function api_fr_photo_create_update($type)
|
|||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_fr_photo_delete($type)
|
||||
{
|
||||
|
@ -4287,6 +4505,10 @@ function api_fr_photo_delete($type)
|
|||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws NotFoundException
|
||||
*/
|
||||
function api_fr_photo_detail($type)
|
||||
{
|
||||
|
@ -4315,6 +4537,11 @@ function api_fr_photo_detail($type)
|
|||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
*
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws NotFoundException
|
||||
* @see https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_image
|
||||
*/
|
||||
function api_account_update_profile_image($type)
|
||||
|
@ -4411,6 +4638,11 @@ api_register_func('api/account/update_profile_image', 'api_account_update_profil
|
|||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_account_update_profile($type)
|
||||
{
|
||||
|
@ -4445,6 +4677,8 @@ api_register_func('api/account/update_profile', 'api_account_update_profile', tr
|
|||
/**
|
||||
*
|
||||
* @param string $acl_string
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
function check_acl_input($acl_string)
|
||||
{
|
||||
|
@ -4481,6 +4715,12 @@ function check_acl_input($acl_string)
|
|||
* @param integer $profile
|
||||
* @param boolean $visibility
|
||||
* @param string $photo_id
|
||||
* @return array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws NotFoundException
|
||||
*/
|
||||
function save_media_to_database($mediatype, $media, $type, $album, $allow_cid, $deny_cid, $allow_gid, $deny_gid, $desc, $profile = 0, $visibility = false, $photo_id = null)
|
||||
{
|
||||
|
@ -4639,6 +4879,7 @@ function save_media_to_database($mediatype, $media, $type, $album, $allow_cid, $
|
|||
* @param string $deny_gid
|
||||
* @param string $filetype
|
||||
* @param boolean $visibility
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function post_photo_item($hash, $allow_cid, $deny_cid, $allow_gid, $deny_gid, $filetype, $visibility = false)
|
||||
{
|
||||
|
@ -4691,6 +4932,12 @@ function post_photo_item($hash, $allow_cid, $deny_cid, $allow_gid, $deny_gid, $f
|
|||
* @param string $photo_id
|
||||
*
|
||||
* @return array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws NotFoundException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function prepare_photo_data($type, $scale, $photo_id)
|
||||
{
|
||||
|
@ -4858,6 +5105,8 @@ api_register_func('api/friendica/remoteauth', 'api_friendica_remoteauth', true);
|
|||
*
|
||||
* @param array $item Sharer item
|
||||
* @return array|false Shared item or false if not a reshare
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_share_as_retweet(&$item)
|
||||
{
|
||||
|
@ -4969,6 +5218,7 @@ function api_share_as_retweet(&$item)
|
|||
* @param string $profile
|
||||
*
|
||||
* @return string|false
|
||||
* @throws InternalServerErrorException
|
||||
* @todo remove trailing junk from profile url
|
||||
* @todo pump.io check has to check the website
|
||||
*/
|
||||
|
@ -5053,6 +5303,7 @@ function api_get_nick($profile)
|
|||
* @param array $item
|
||||
*
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
function api_in_reply_to($item)
|
||||
{
|
||||
|
@ -5108,6 +5359,7 @@ function api_in_reply_to($item)
|
|||
* @param string $text
|
||||
*
|
||||
* @return string
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_clean_plain_items($text)
|
||||
{
|
||||
|
@ -5134,6 +5386,7 @@ function api_clean_plain_items($text)
|
|||
* @param string $body The original body
|
||||
*
|
||||
* @return string Cleaned body
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_clean_attachments($body)
|
||||
{
|
||||
|
@ -5162,7 +5415,7 @@ function api_clean_attachments($body)
|
|||
*
|
||||
* @param array $contacts
|
||||
*
|
||||
* @return array
|
||||
* @return void
|
||||
*/
|
||||
function api_best_nickname(&$contacts)
|
||||
{
|
||||
|
@ -5232,6 +5485,11 @@ function api_best_nickname(&$contacts)
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_friendica_group_show($type)
|
||||
{
|
||||
|
@ -5297,6 +5555,11 @@ api_register_func('api/friendica/group_show', 'api_friendica_group_show', true);
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_friendica_group_delete($type)
|
||||
{
|
||||
|
@ -5358,6 +5621,11 @@ api_register_func('api/friendica/group_delete', 'api_friendica_group_delete', tr
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-destroy
|
||||
*/
|
||||
function api_lists_destroy($type)
|
||||
|
@ -5406,6 +5674,7 @@ api_register_func('api/lists/destroy', 'api_lists_destroy', true, API_METHOD_DEL
|
|||
* @param array $users List of users to add to the group
|
||||
*
|
||||
* @return array
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
function group_create($name, $uid, $users = [])
|
||||
{
|
||||
|
@ -5475,6 +5744,11 @@ function group_create($name, $uid, $users = [])
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_friendica_group_create($type)
|
||||
{
|
||||
|
@ -5503,6 +5777,11 @@ api_register_func('api/friendica/group_create', 'api_friendica_group_create', tr
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-create
|
||||
*/
|
||||
function api_lists_create($type)
|
||||
|
@ -5538,6 +5817,11 @@ api_register_func('api/lists/create', 'api_lists_create', true, API_METHOD_POST)
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_friendica_group_update($type)
|
||||
{
|
||||
|
@ -5611,6 +5895,11 @@ api_register_func('api/friendica/group_update', 'api_friendica_group_update', tr
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
* @see https://developer.twitter.com/en/docs/accounts-and-users/create-manage-lists/api-reference/post-lists-update
|
||||
*/
|
||||
function api_lists_update($type)
|
||||
|
@ -5658,6 +5947,10 @@ api_register_func('api/lists/update', 'api_lists_update', true, API_METHOD_POST)
|
|||
* @param string $type Return type (atom, rss, xml, json)
|
||||
*
|
||||
* @return array|string
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_friendica_activity($type)
|
||||
{
|
||||
|
@ -5702,6 +5995,9 @@ api_register_func('api/friendica/activity/unattendmaybe', 'api_friendica_activit
|
|||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
function api_friendica_notification($type)
|
||||
{
|
||||
|
@ -5737,6 +6033,11 @@ function api_friendica_notification($type)
|
|||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_friendica_notification_seen($type)
|
||||
{
|
||||
|
@ -5782,6 +6083,11 @@ api_register_func('api/friendica/notification', 'api_friendica_notification', tr
|
|||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
* @return string|array (success result=ok, error result=error with error message)
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_friendica_direct_messages_setseen($type)
|
||||
{
|
||||
|
@ -5831,6 +6137,11 @@ api_register_func('api/friendica/direct_messages_setseen', 'api_friendica_direct
|
|||
* @return string|array (success: success=true if found and search_result contains found messages,
|
||||
* success=false if nothing was found, search_result='nothing found',
|
||||
* error: result=error with error message)
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_friendica_direct_messages_search($type, $box = "")
|
||||
{
|
||||
|
@ -5894,6 +6205,11 @@ api_register_func('api/friendica/direct_messages_search', 'api_friendica_direct_
|
|||
*
|
||||
* @param string $type Known types are 'atom', 'rss', 'xml' and 'json'
|
||||
* @return string|array
|
||||
* @throws BadRequestException
|
||||
* @throws ForbiddenException
|
||||
* @throws ImagickException
|
||||
* @throws InternalServerErrorException
|
||||
* @throws UnauthorizedException
|
||||
*/
|
||||
function api_friendica_profile_show($type)
|
||||
{
|
||||
|
@ -5975,6 +6291,7 @@ api_register_func('api/friendica/profile/show', 'api_friendica_profile_show', tr
|
|||
* @param string $type Return format: json or xml
|
||||
*
|
||||
* @return string|array
|
||||
* @throws Exception
|
||||
*/
|
||||
function api_saved_searches_list($type)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* load view/theme/$current_theme/style.php with friendica contex
|
||||
* load view/theme/$current_theme/style.php with friendica context
|
||||
*
|
||||
* @param App $a
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user