diff --git a/src/Module/Api/Mastodon/Accounts.php b/src/Module/Api/Mastodon/Accounts.php index 0d48744a4..a5c9b8104 100644 --- a/src/Module/Api/Mastodon/Accounts.php +++ b/src/Module/Api/Mastodon/Accounts.php @@ -38,7 +38,7 @@ class Accounts extends BaseApi public static function rawContent(array $parameters = []) { if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $id = $parameters['id']; diff --git a/src/Module/Api/Mastodon/Accounts/Followers.php b/src/Module/Api/Mastodon/Accounts/Followers.php index ab2ca6839..7e082edbd 100644 --- a/src/Module/Api/Mastodon/Accounts/Followers.php +++ b/src/Module/Api/Mastodon/Accounts/Followers.php @@ -41,7 +41,7 @@ class Followers extends BaseApi $uid = self::getCurrentUserID(); if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $id = $parameters['id']; diff --git a/src/Module/Api/Mastodon/Accounts/Following.php b/src/Module/Api/Mastodon/Accounts/Following.php index 414213dc4..87e9117ea 100644 --- a/src/Module/Api/Mastodon/Accounts/Following.php +++ b/src/Module/Api/Mastodon/Accounts/Following.php @@ -41,7 +41,7 @@ class Following extends BaseApi $uid = self::getCurrentUserID(); if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $id = $parameters['id']; diff --git a/src/Module/Api/Mastodon/Accounts/Lists.php b/src/Module/Api/Mastodon/Accounts/Lists.php index b15124a45..6ba7953ab 100644 --- a/src/Module/Api/Mastodon/Accounts/Lists.php +++ b/src/Module/Api/Mastodon/Accounts/Lists.php @@ -42,7 +42,7 @@ class Lists extends BaseApi $uid = self::getCurrentUserID(); if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $id = $parameters['id']; diff --git a/src/Module/Api/Mastodon/Accounts/Statuses.php b/src/Module/Api/Mastodon/Accounts/Statuses.php index 14cd19e42..b3aec744e 100644 --- a/src/Module/Api/Mastodon/Accounts/Statuses.php +++ b/src/Module/Api/Mastodon/Accounts/Statuses.php @@ -43,7 +43,7 @@ class Statuses extends BaseApi public static function rawContent(array $parameters = []) { if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $id = $parameters['id']; diff --git a/src/Module/Api/Mastodon/Accounts/VerifyCredentials.php b/src/Module/Api/Mastodon/Accounts/VerifyCredentials.php index 94fa32684..facae7259 100644 --- a/src/Module/Api/Mastodon/Accounts/VerifyCredentials.php +++ b/src/Module/Api/Mastodon/Accounts/VerifyCredentials.php @@ -43,12 +43,12 @@ class VerifyCredentials extends BaseApi $self = User::getOwnerDataById($uid); if (empty($self)) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->InternalError(); } $cdata = Contact::getPublicAndUserContacID($self['id'], $uid); if (empty($cdata)) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->InternalError(); } // @todo Support the source property, diff --git a/src/Module/Api/Mastodon/Blocks.php b/src/Module/Api/Mastodon/Blocks.php index af8e77f88..e93743ac2 100644 --- a/src/Module/Api/Mastodon/Blocks.php +++ b/src/Module/Api/Mastodon/Blocks.php @@ -41,7 +41,7 @@ class Blocks extends BaseApi $uid = self::getCurrentUserID(); if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $id = $parameters['id']; diff --git a/src/Module/Api/Mastodon/Lists/Accounts.php b/src/Module/Api/Mastodon/Lists/Accounts.php index 513ca21d7..cb2bd208f 100644 --- a/src/Module/Api/Mastodon/Lists/Accounts.php +++ b/src/Module/Api/Mastodon/Lists/Accounts.php @@ -53,7 +53,7 @@ class Accounts extends BaseApi $uid = self::getCurrentUserID(); if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $id = $parameters['id']; diff --git a/src/Module/Api/Mastodon/Media.php b/src/Module/Api/Mastodon/Media.php index bc55610b2..297d7d7a3 100644 --- a/src/Module/Api/Mastodon/Media.php +++ b/src/Module/Api/Mastodon/Media.php @@ -46,7 +46,7 @@ class Media extends BaseApi $uid = self::getCurrentUserID(); if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $id = $parameters['id']; diff --git a/src/Module/Api/Mastodon/Mutes.php b/src/Module/Api/Mastodon/Mutes.php index cb981b33e..d49bdad68 100644 --- a/src/Module/Api/Mastodon/Mutes.php +++ b/src/Module/Api/Mastodon/Mutes.php @@ -41,7 +41,7 @@ class Mutes extends BaseApi $uid = self::getCurrentUserID(); if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $id = $parameters['id']; diff --git a/src/Module/Api/Mastodon/Statuses.php b/src/Module/Api/Mastodon/Statuses.php index 042d038a2..900452385 100644 --- a/src/Module/Api/Mastodon/Statuses.php +++ b/src/Module/Api/Mastodon/Statuses.php @@ -42,7 +42,7 @@ class Statuses extends BaseApi public static function rawContent(array $parameters = []) { if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } System::jsonExit(DI::mstdnStatus()->createFromUriId($parameters['id'], self::getCurrentUserID())); diff --git a/src/Module/Api/Mastodon/Statuses/Context.php b/src/Module/Api/Mastodon/Statuses/Context.php index 5615e41cc..345a473db 100644 --- a/src/Module/Api/Mastodon/Statuses/Context.php +++ b/src/Module/Api/Mastodon/Statuses/Context.php @@ -41,7 +41,7 @@ class Context extends BaseApi $uid = self::getCurrentUserID(); if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $id = $parameters['id']; diff --git a/src/Module/Api/Mastodon/Statuses/FavouritedBy.php b/src/Module/Api/Mastodon/Statuses/FavouritedBy.php index 7c784c802..cecf0336a 100644 --- a/src/Module/Api/Mastodon/Statuses/FavouritedBy.php +++ b/src/Module/Api/Mastodon/Statuses/FavouritedBy.php @@ -41,7 +41,7 @@ class FavouritedBy extends BaseApi $uid = self::getCurrentUserID(); if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $id = $parameters['id']; diff --git a/src/Module/Api/Mastodon/Statuses/RebloggedBy.php b/src/Module/Api/Mastodon/Statuses/RebloggedBy.php index 3701afb0d..9faf034ae 100644 --- a/src/Module/Api/Mastodon/Statuses/RebloggedBy.php +++ b/src/Module/Api/Mastodon/Statuses/RebloggedBy.php @@ -41,7 +41,7 @@ class RebloggedBy extends BaseApi $uid = self::getCurrentUserID(); if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $id = $parameters['id']; diff --git a/src/Module/Api/Mastodon/Timelines/ListTimeline.php b/src/Module/Api/Mastodon/Timelines/ListTimeline.php index df5c21122..7da16d137 100644 --- a/src/Module/Api/Mastodon/Timelines/ListTimeline.php +++ b/src/Module/Api/Mastodon/Timelines/ListTimeline.php @@ -43,7 +43,7 @@ class ListTimeline extends BaseApi $uid = self::getCurrentUserID(); if (empty($parameters['id'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } // Return results older than id diff --git a/src/Module/Api/Mastodon/Timelines/Tag.php b/src/Module/Api/Mastodon/Timelines/Tag.php index f61e3c3f7..7218f40cb 100644 --- a/src/Module/Api/Mastodon/Timelines/Tag.php +++ b/src/Module/Api/Mastodon/Timelines/Tag.php @@ -44,7 +44,7 @@ class Tag extends BaseApi $uid = self::getCurrentUserID(); if (empty($parameters['hashtag'])) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } // If true, return only local statuses. Defaults to false. diff --git a/src/Module/OAuth/Authorize.php b/src/Module/OAuth/Authorize.php index c9bf7b687..7d9f67ad3 100644 --- a/src/Module/OAuth/Authorize.php +++ b/src/Module/OAuth/Authorize.php @@ -39,12 +39,12 @@ class Authorize extends BaseApi $response_type = $_REQUEST['response_type'] ?? ''; if ($response_type != 'code') { Logger::warning('Wrong or missing response type', ['response_type' => $response_type]); - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $application = self::getApplication(); if (empty($application)) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } $request = $_REQUEST; @@ -68,7 +68,7 @@ class Authorize extends BaseApi $token = self::createTokenForUser($application, $uid); if (!$token) { - DI::mstdnError()->RecordNotFound(); + DI::mstdnError()->UnprocessableEntity(); } DI::app()->redirect($application['redirect_uri'] . '?code=' . $token['code']);