X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapigroupleave.php;h=9d2825b00e25ea9add0652731909ef1d7ced6ef7;hb=0e439117a75698629c5066d0241ab41dc07b5ee1;hp=083ebd890f2c0b38e85e4f927b95e120ed08913c;hpb=641018e95051b029dcd57a4eb304ee545230136a;p=quix0rs-gnu-social.git diff --git a/actions/apigroupleave.php b/actions/apigroupleave.php index 083ebd890f..9d2825b00e 100644 --- a/actions/apigroupleave.php +++ b/actions/apigroupleave.php @@ -117,10 +117,7 @@ class ApiGroupLeaveAction extends ApiAuthAction } try { - if (Event::handle('StartLeaveGroup', array($this->group,$this->user))) { - Group_member::leave($this->group->id, $this->user->id); - Event::handle('EndLeaveGroup', array($this->group, $this->user)); - } + $this->user->leaveGroup($this->group); } catch (Exception $e) { // TRANS: Server error displayed when leaving a group failed in the database. // TRANS: %1$s is the leaving user's nickname, $2$s is the group nickname for which the leave failed. @@ -137,7 +134,7 @@ class ApiGroupLeaveAction extends ApiAuthAction break; default: $this->clientError( - // TRANS: Client error displayed trying to execute an unknown API method leaving a group. + // TRANS: Client error displayed when coming across a non-supported API method. _('API method not found.'), 404, $this->format