From d2443f778570803939a2e6697bb703d05279f826 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Wed, 15 Dec 2021 16:21:43 +0000 Subject: [PATCH] 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 --- extension.json | 6 +++--- includes/ApiDiscussionToolsEdit.php | 2 +- includes/Notifications/EventDispatcher.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extension.json b/extension.json index 72a043699..114c9efbf 100644 --- a/extension.json +++ b/extension.json @@ -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, diff --git a/includes/ApiDiscussionToolsEdit.php b/includes/ApiDiscussionToolsEdit.php index e00c60639..a7d1eb14f 100644 --- a/includes/ApiDiscussionToolsEdit.php +++ b/includes/ApiDiscussionToolsEdit.php @@ -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 = ''; diff --git a/includes/Notifications/EventDispatcher.php b/includes/Notifications/EventDispatcher.php index e70a6ca35..f354496c1 100644 --- a/includes/Notifications/EventDispatcher.php +++ b/includes/Notifications/EventDispatcher.php @@ -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' );