Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old OC_Hook for OC_Group events #24041

Merged

Conversation

MorrisJobke
Copy link
Member

Those mappings exist and we will remove the first ones (labeled as old):

old: \OC_Hook::listen('OC_Group', 'pre_createGroup', ...);
since OC 8 (owncloud/core#12618): $groupManager->listen('\OC\Group', 'preCreate', ...);
since NC 17 (#18350): OCP\Group\Events\BeforeGroupCreatedEvent

old: \OC_Hook::emit('OC_User', 'post_createGroup', ...);
since OC 8 (owncloud/core#12618): $groupManager->listen('\OC\Group', 'postCreate', ...);
since NC 17 (#18350): OCP\Group\Events\GroupCreatedEvent

old: \OC_Hook::emit('OC_Group', 'pre_deleteGroup', ...);
since OC 8 (owncloud/core#12618): $groupManager->listen('\OC\Group', 'preDelete', ...);
since NC 17 (#18350): OCP\Group\Events\BeforeGroupDeletedEvent

old: \OC_Hook::emit('OC_User', 'post_deleteGroup', ...);
since OC 8 (owncloud/core#12618): $groupManager->listen('\OC\Group', 'postDelete', ...);
since NC 17 (#18350): OCP\Group\Events\GroupDeletedEvent

old: \OC_Hook::emit('OC_Group', 'pre_addToGroup', ...);
since OC 8 (owncloud/core#12618): $groupManager->listen('\OC\Group', 'preAddUser', ...);
since NC 17 (#18350): OCP\Group\Events\BeforeUserAddedEvent

old: \OC_Hook::emit('OC_Group', 'post_addToGroup', ...);
since OC 8 (owncloud/core#12618): $groupManager->listen('\OC\Group', 'postAddUser', ...);
since NC 17 (#18350): OCP\Group\Events\UserAddedEvent

I only found the circles app to still use them: nextcloud/circles#515

Those mappings exist and we will remove the first ones (labeled as `old`):

old: `\OC_Hook::listen('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid));`
since OC 8 (owncloud/core#12618): `$groupManager->listen('\OC\Group', 'preCreate', function ($gid) { ... });`
since NC 17 (#18350): `OCP\Group\Events\BeforeGroupCreatedEvent`

old: `\OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID()));`
since OC 8 (owncloud/core#12618): `$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { ... });`
since NC 17 (#18350): `OCP\Group\Events\GroupCreatedEvent`

old: `\OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID()));`
since OC 8 (owncloud/core#12618): `$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { ... });`
since NC 17 (#18350): `OCP\Group\Events\BeforeGroupDeletedEvent`

old: `\OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID()));`
since OC 8 (owncloud/core#12618): `$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { ... });`
since NC 17 (#18350): `OCP\Group\Events\GroupDeletedEvent`

old: `\OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()));`
since OC 8 (owncloud/core#12618): `$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { ... });`
since NC 17 (#18350): `OCP\Group\Events\BeforeUserAddedEvent`

old: `\OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));`
since OC 8 (owncloud/core#12618): `$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { ... });`
since NC 17 (#18350): `OCP\Group\Events\UserAddedEvent`

Signed-off-by: Morris Jobke <[email protected]>
Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@juliusknorr juliusknorr merged commit 61496d3 into master Nov 11, 2020
@juliusknorr juliusknorr deleted the techdebt/noid/remove-oc_hooks-for-group-management branch November 11, 2020 10:17
@MorrisJobke
Copy link
Member Author

Added to #23210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants