Switch things from calling Group_member::join & leave & calling events manually to running through Profile::joinGroup() && Profile::leaveGroup(), with the events encapsulated.
This commit is contained in:
@@ -68,10 +68,7 @@ class ForceGroupPlugin extends Plugin
|
||||
$group = User_group::getForNickname($nickname);
|
||||
if ($group && !$profile->isMember($group)) {
|
||||
try {
|
||||
if (Event::handle('StartJoinGroup', array($group, $user))) {
|
||||
Group_member::join($group->id, $user->id);
|
||||
Event::handle('EndJoinGroup', array($group, $user));
|
||||
}
|
||||
$profile->joinGroup($group);
|
||||
} catch (Exception $e) {
|
||||
// TRANS: Server exception.
|
||||
// TRANS: %1$s is a user nickname, %2$s is a group nickname.
|
||||
|
Reference in New Issue
Block a user