X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fleavegroup.php;h=b8aaf83d20d737ec54faad176680873ef893f44d;hb=2a70ed27e71e2e6e88359c88229d9c9ac5bb91a0;hp=f5d1ccd08ca456e814d108b93958674e2f20eeec;hpb=59a0b2a82da418f688faf182407146d9e7a7af7a;p=quix0rs-gnu-social.git diff --git a/actions/leavegroup.php b/actions/leavegroup.php index f5d1ccd08c..b8aaf83d20 100644 --- a/actions/leavegroup.php +++ b/actions/leavegroup.php @@ -123,11 +123,9 @@ 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) { + common_log(LOG_ERR, "Error when {$cur->nickname} tried to leave {$this->group->nickname}: " . $e->getMessage()); // 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. $this->serverError(sprintf(_('Could not remove user %1$s from group %2$s.'),