mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 08:23:52 +00:00
Auto topic subscriptions disabled by default, enabled only for new users when out of beta
Bug: T294398 Change-Id: I909caaebbb976624a16f15361d4ee232007ff506
This commit is contained in:
parent
90283b3a7e
commit
9adbbccad8
|
@ -497,7 +497,7 @@
|
|||
"discussiontools-replytool": 1,
|
||||
"discussiontools-sourcemodetoolbar": 1,
|
||||
"discussiontools-topicsubscription": 1,
|
||||
"discussiontools-autotopicsub": 1,
|
||||
"discussiontools-autotopicsub": 0,
|
||||
"discussiontools-abtest": ""
|
||||
},
|
||||
"config": {
|
||||
|
|
|
@ -201,10 +201,17 @@ class PreferenceHooks implements
|
|||
* @return bool|void True or no return value to continue or false to abort
|
||||
*/
|
||||
public function onLocalUserCreated( $user, $autocreated ) {
|
||||
// We want new users to be created with email-subscriptions to our notifications enabled
|
||||
if ( !$autocreated ) {
|
||||
$userOptionsManager = MediaWikiServices::getInstance()->getUserOptionsManager();
|
||||
// We want new users to be created with email-subscriptions to our notifications enabled
|
||||
$userOptionsManager->setOption( $user, 'echo-subscriptions-email-dt-subscription', true );
|
||||
// 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 );
|
||||
}
|
||||
$user->saveSettings();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue