Alkir
You should be able to re-define the preference with true as the default. You could add the following to your extend.php array or extension. If it's added to an extension it need an additional priority set to make sure it runs after the subscription extension.
$events->listen(ConfigureUserPreferences::class, function (ConfigureUserPreferences $event) {
$event->add('followAfterReply', 'boolval', true);
});
If you don't want to let the user choose at all, there are a few solutions (in addition to setting true as default):
- You could hide the control in the user settings with CSS. People with knowledge of the Flarum API will still be able to disable it, although it will be tedious
- Use a middleware to intercept the request to save the user preferences and remove the
followAfterReply preference from the payload
- Remove the FollowAfterReply listener added by the Subscriptions extension and replace it with your own that doesn't care about the user preference
I noticed there's no event for the saving and retrieving of the preferences. It would have made the second option a bit easier.
The code above was not tested. If you're going to paste it in the forum extend.php, better check on a local install first!
Related: The Default User Preferences extension, but I don't think it covers the "automatically follow" preference.