]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/leavegroup.php
Switch things from calling Group_member::join & leave & calling events manually to...
[quix0rs-gnu-social.git] / actions / leavegroup.php
index f5d1ccd08ca456e814d108b93958674e2f20eeec..9e560b971721a452b5c7ba668ff682562f8b668b 100644 (file)
@@ -123,10 +123,7 @@ class LeavegroupAction extends Action
         $cur = common_current_user();
 
         try {
-            if (Event::handle('StartLeaveGroup', array($this->group, $cur))) {
-                Group_member::leave($this->group->id, $cur->id);
-                Event::handle('EndLeaveGroup', array($this->group, $cur));
-            }
+            $cur->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.