X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapilistsubscribers.php;h=66cb5f17d7434d720cfc75aab55571d1773f88df;hb=0a20abf1d8a9a068df9310d6903cc303f39b25ed;hp=e8468a195d138993c800976cb82f705bebf96f45;hpb=31c1177970124cee31823cab3a11542c23b4126d;p=quix0rs-gnu-social.git diff --git a/actions/apilistsubscribers.php b/actions/apilistsubscribers.php index e8468a195d..66cb5f17d7 100644 --- a/actions/apilistsubscribers.php +++ b/actions/apilistsubscribers.php @@ -38,19 +38,14 @@ class ApiListSubscribersAction extends ApiListUsersAction * * @return boolean success */ - function handlePost() { $result = Profile_tag_subscription::add($this->list, $this->auth_user); if(empty($result)) { - $this->clientError( - _('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,13 +56,8 @@ class ApiListSubscribersAction extends ApiListUsersAction $this->showSingleJsonList($this->list); break; default: - $this->clientError( - _('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); } } @@ -78,23 +68,15 @@ class ApiListSubscribersAction extends ApiListUsersAction $ptag = Profile_tag_subscription::pkeyGet($args); if(empty($ptag)) { - $this->clientError( - _('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( - _('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) { @@ -105,13 +87,8 @@ class ApiListSubscribersAction extends ApiListUsersAction $this->showSingleJsonList($this->list); break; default: - $this->clientError( - _('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; }