]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apigroupleave.php
Updating Janrain OpenID auth library
[quix0rs-gnu-social.git] / actions / apigroupleave.php
index 083ebd890f2c0b38e85e4f927b95e120ed08913c..bdfa36aa432bf682623a09bd6e82f9e44a80e32f 100644 (file)
@@ -35,8 +35,6 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/lib/apiauth.php';
-
 /**
  * Removes the authenticated user from the group specified by ID
  *
@@ -117,10 +115,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 +132,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