X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fapigroupjoin.php;h=e18e20c5dd3bc2496cc02af15d0cdc5b22b279a9;hb=cd6fa512ac0d382871384a9c7604abd8a7ed0566;hp=2e35cb87de364636e247e95953507703bc7f8069;hpb=641018e95051b029dcd57a4eb304ee545230136a;p=quix0rs-gnu-social.git diff --git a/actions/apigroupjoin.php b/actions/apigroupjoin.php index 2e35cb87de..e18e20c5dd 100644 --- a/actions/apigroupjoin.php +++ b/actions/apigroupjoin.php @@ -35,8 +35,6 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/apiauth.php'; - /** * Joins the authenticated user to the group speicified by ID * @@ -126,10 +124,7 @@ class ApiGroupJoinAction extends ApiAuthAction } try { - if (Event::handle('StartJoinGroup', array($this->group, $this->user))) { - Group_member::join($this->group->id, $this->user->id); - Event::handle('EndJoinGroup', array($this->group, $this->user)); - } + $this->user->joinGroup($this->group); } catch (Exception $e) { // TRANS: Server error displayed when joining a group failed in the database. // TRANS: %1$s is the joining user's nickname, $2$s is the group nickname for which the join failed. @@ -147,7 +142,7 @@ class ApiGroupJoinAction extends ApiAuthAction break; default: $this->clientError( - // TRANS: Client error displayed trying to execute an unknown API method joining a group. + // TRANS: Client error displayed when coming across a non-supported API method. _('API method not found.'), 404, $this->format