diff --git a/extension.json b/extension.json index 34065b813..528226988 100644 --- a/extension.json +++ b/extension.json @@ -437,7 +437,6 @@ "ResourceLoaderGetConfigVars": "resourceloader", "GetBetaFeaturePreferences": "betapreferences", "GetPreferences": "preferences", - "LocalUserCreated": "preferences", "DiscussionToolsAddOverflowMenuItems": "discussiontools", "ChangeTagsListActive": "tags", "ListDefinedTags": "tags", diff --git a/includes/Hooks/PreferenceHooks.php b/includes/Hooks/PreferenceHooks.php index 52faabd8b..d233c9abb 100644 --- a/includes/Hooks/PreferenceHooks.php +++ b/includes/Hooks/PreferenceHooks.php @@ -9,18 +9,15 @@ namespace MediaWiki\Extension\DiscussionTools\Hooks; -use MediaWiki\Auth\Hook\LocalUserCreatedHook; use MediaWiki\Config\Config; use MediaWiki\Config\ConfigFactory; use MediaWiki\Html\Html; use MediaWiki\Linker\LinkRenderer; -use MediaWiki\MediaWikiServices; use MediaWiki\Preferences\Hook\GetPreferencesHook; use MediaWiki\SpecialPage\SpecialPage; use MediaWiki\User\User; class PreferenceHooks implements - LocalUserCreatedHook, GetPreferencesHook { @@ -207,27 +204,4 @@ class PreferenceHooks implements } } - /** - * Handler for LocalUserCreated hook. - * @see https://www.mediawiki.org/wiki/Manual:Hooks/LocalUserCreated - * @param User $user User object for the created user - * @param bool $autocreated Whether this was an auto-creation - * @return bool|void True or no return value to continue or false to abort - */ - public function onLocalUserCreated( $user, $autocreated ) { - if ( $user->isTemp() ) { - // Temp users can't have preferences (and we don't let them have topic subscriptions anyway) - return; - } - - $userOptionsManager = MediaWikiServices::getInstance()->getUserOptionsManager(); - // The auto topic subscription feature is disabled by default for existing users, but - // we enable it for new users (T294398). - // This can only occur when the feature is available for everyone; when it's in beta, - // the new user won't have the beta enabled, so it'll never be available here. - if ( HookUtils::isFeatureAvailableToUser( $user, HookUtils::AUTOTOPICSUB ) ) { - $userOptionsManager->setOption( $user, 'discussiontools-' . HookUtils::AUTOTOPICSUB, 1 ); - } - } - }