X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapilistsubscribers.php;h=66cb5f17d7434d720cfc75aab55571d1773f88df;hb=0baa9debbca911ba43b289624b5acbbb94469828;hp=480f9b4a5f2fd2d70d76bcff08d53ee273f4a957;hpb=7a9777df053a9007b5eaa71f5437584065b615a5;p=quix0rs-gnu-social.git diff --git a/actions/apilistsubscribers.php b/actions/apilistsubscribers.php index 480f9b4a5f..66cb5f17d7 100644 --- a/actions/apilistsubscribers.php +++ b/actions/apilistsubscribers.php @@ -44,13 +44,8 @@ class ApiListSubscribersAction extends ApiListUsersAction $this->auth_user); if(empty($result)) { - $this->clientError( - // TRANS: Client error displayed when an unknown error occurs in the list subscribers action. - _('An error occured.'), - 500, - $this->format - ); - return false; + // TRANS: Client error displayed when an unknown error occurs in the list subscribers action. + $this->clientError(_('An error occured.'), 500); } switch($this->format) { @@ -61,14 +56,8 @@ class ApiListSubscribersAction extends ApiListUsersAction $this->showSingleJsonList($this->list); break; default: - $this->clientError( - // TRANS: Client error displayed when coming across a non-supported API method. - _('API method not found.'), - 404, - $this->format - ); - return false; - break; + // TRANS: Client error displayed when coming across a non-supported API method. + $this->clientError(_('API method not found.'), 404); } } @@ -79,25 +68,15 @@ class ApiListSubscribersAction extends ApiListUsersAction $ptag = Profile_tag_subscription::pkeyGet($args); if(empty($ptag)) { - $this->clientError( - // TRANS: Client error displayed when trying to unsubscribe from a non-subscribed list. - _('You are not subscribed to this list.'), - 400, - $this->format - ); - return false; + // TRANS: Client error displayed when trying to unsubscribe from a non-subscribed list. + $this->clientError(_('You are not subscribed to this list.')); } - Profile_tag_subscription::remove($this->list, $this->auth_user); + $result = Profile_tag_subscription::remove($this->list, $this->auth_user); - if(empty($result)) { - $this->clientError( - // TRANS: Client error displayed when an unknown error occurs unsubscribing from a list. - _('An error occured.'), - 500, - $this->format - ); - return false; + if (empty($result)) { + // TRANS: Client error displayed when an unknown error occurs unsubscribing from a list. + $this->clientError(_('An error occured.'), 500); } switch($this->format) { @@ -108,14 +87,8 @@ class ApiListSubscribersAction extends ApiListUsersAction $this->showSingleJsonList($this->list); break; default: - $this->clientError( - // TRANS: Client error displayed when coming across a non-supported API method. - _('API method not found.'), - 404, - $this->format - ); - return false; - break; + // TRANS: Client error displayed when coming across a non-supported API method. + $this->clientError(_('API method not found.'), 404); } return true; }