$cur = common_current_user();
try {
- if (Event::handle('StartJoinGroup', array($this->group, $cur))) {
- Group_member::join($this->group->id, $cur->id);
- Event::handle('EndJoinGroup', array($this->group, $cur));
- }
+ $cur->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.