X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FApi%2FMastodon%2FLists%2FAccounts.php;h=feb670b271182644400a5353212e7744df9ca73a;hb=87084a3e854b72290fcc49e66fd0ccdf737672ee;hp=b83f4903a9db0cd8d254d9ae165ae60a3364c7a7;hpb=877b90f7f032b1b053006f7599b633c63c0b564b;p=friendica.git diff --git a/src/Module/Api/Mastodon/Lists/Accounts.php b/src/Module/Api/Mastodon/Lists/Accounts.php index b83f4903a9..feb670b271 100644 --- a/src/Module/Api/Mastodon/Lists/Accounts.php +++ b/src/Module/Api/Mastodon/Lists/Accounts.php @@ -35,30 +35,29 @@ use Friendica\Module\BaseApi; */ class Accounts extends BaseApi { - public static function delete(array $parameters = []) + public function delete() { DI::apiResponse()->unsupported(Router::DELETE); } - public static function post(array $parameters = []) + public function post() { DI::apiResponse()->unsupported(Router::POST); } /** - * @param array $parameters * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function rawContent(array $parameters = []) + public function rawContent() { self::checkAllowedScope(self::SCOPE_READ); $uid = self::getCurrentUserID(); - if (empty($parameters['id'])) { + if (empty($this->parameters['id'])) { DI::mstdnError()->UnprocessableEntity(); } - $id = $parameters['id']; + $id = $this->parameters['id']; if (!DBA::exists('group', ['id' => $id, 'uid' => $uid])) { DI::mstdnError()->RecordNotFound(); } @@ -66,6 +65,7 @@ class Accounts extends BaseApi $request = self::getRequest([ 'max_id' => 0, // Return results older than this id 'since_id' => 0, // Return results newer than this id + 'min_id' => 0, // Return results immediately newer than id 'limit' => 40, // Maximum number of results. Defaults to 40. Max 40. Set to 0 in order to get all accounts without pagination. ]); @@ -85,8 +85,8 @@ class Accounts extends BaseApi $condition = DBA::mergeConditions($condition, ["`contact-id` > ?", $request['since_id']]); } - if (!empty($min_id)) { - $condition = DBA::mergeConditions($condition, ["`contact-id` > ?", $min_id]); + if (!empty($request['min_id'])) { + $condition = DBA::mergeConditions($condition, ["`contact-id` > ?", $request['min_id']]); $params['order'] = ['contact-id']; } @@ -100,7 +100,7 @@ class Accounts extends BaseApi } DBA::close($members); - if (!empty($min_id)) { + if (!empty($request['min_id'])) { array_reverse($accounts); }