Rename DiscussionToolsAutoTopicSubWhere to DiscussionToolsAutoTopicSubEditor

Better describes that we are checking the editor used to make
the edit, rather than descibing some virtual "location".

Change options to 'discussiontoolsapi' and 'any'.

Change-Id: I3024517e70ed61c738e4bf46a2ac7b58c975d98a
This commit is contained in:
Ed Sanders 2021-12-15 16:21:43 +00:00
parent f731b7a575
commit d2443f7785
3 changed files with 5 additions and 5 deletions

View file

@ -545,9 +545,9 @@
"value": true,
"description": "Enable the topic subscription backend. This controls whether the feature can be tried out using the query parameter, and whether the Echo events will be created. Do not enable this unless the database tables exist. Do enable it before making the 'topicsubscription' feature available."
},
"DiscussionToolsAutoTopicSubWhere": {
"value": "replynewtopic",
"description": "In what scenarios automatic topic subscriptions are added. Either 'replynewtopic' for only edits made using our reply tool and new topic tool, or 'everywhere' for every edit."
"DiscussionToolsAutoTopicSubEditor": {
"value": "discussiontoolsapi",
"description": "Editor which triggers automatic topic subscriptions. Either 'discussiontoolsapi' for edits made using DiscussionTools' API (e.g. reply and new topic tools), or 'any' for any editor."
},
"DiscussionToolsTalkPageParserCacheExpiry": {
"value": 0,

View file

@ -38,7 +38,7 @@ class ApiDiscussionToolsEdit extends ApiBase {
$dtConfig = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'discussiontools' );
$autoSubscribe =
$dtConfig->get( 'DiscussionToolsEnableTopicSubscriptionBackend' ) &&
$dtConfig->get( 'DiscussionToolsAutoTopicSubWhere' ) === 'replynewtopic' &&
$dtConfig->get( 'DiscussionToolsAutoTopicSubEditor' ) === 'discussiontoolsapi' &&
HookUtils::shouldAddAutoSubscription( $this->getUser(), $title );
$subscribableHeadingName = null;
$subscribableSectionTitle = '';

View file

@ -298,7 +298,7 @@ class EventDispatcher {
if (
$dtConfig->get( 'DiscussionToolsEnableTopicSubscriptionBackend' ) &&
$dtConfig->get( 'DiscussionToolsAutoTopicSubWhere' ) === 'everywhere' &&
$dtConfig->get( 'DiscussionToolsAutoTopicSubEditor' ) === 'any' &&
HookUtils::shouldAddAutoSubscription( $user, $title )
) {
$subscriptionStore = MediaWikiServices::getInstance()->getService( 'DiscussionTools.SubscriptionStore' );