[2.x] feat(subscriptions): add support for auto follow discussions on create#4464
[2.x] feat(subscriptions): add support for auto follow discussions on create#4464huoxin233 wants to merge 7 commits intoflarum:2.xfrom
Conversation
imorland
left a comment
There was a problem hiding this comment.
The implementation is clean and closely mirrors FollowAfterReply. A few things to address:
Default preference should be false
->registerPreference('followAfterCreate', 'boolval', false)This is an opt-in behaviour — existing users who've never saved this preference would have it silently enabled after upgrading. Please change the default to false.
Tests needed
FollowAfterReply has integration test coverage — FollowAfterCreate should too. At minimum: a user with followAfterCreate = true ends up subscribed after starting a discussion, and a user with followAfterCreate = false does not.
followAfterCreateLoading not declared on the component
This works via dynamic properties the same way followAfterReplyLoading does, but it should be explicitly declared on SettingsPage alongside the existing loading flags.
Locale string tense
follow_after_create_label reads "discussions that I created" (past tense). Should match the existing pattern: "discussions that I create".
StyleCI
StyleCI is flagging issues — please address before we can merge.
|
Note: this is marked for beta.8 — feature cut-off is midday CET this Sunday. If the above isn't addressed in time it will have to wait until Flarum 2.1. |
|
All fixed! |
Changes proposed in this pull request:
This PR introduces a new setting in the
flarum/subscriptionsextension that automatically subscribes users to discussions they created.The original
followAfterReplydoes cover discussion creation also, but not all users will want to follow every discussion they reply to, thats why afollowAfterCreateis needed.The default preference for
followAfterCreateis set to true as discussion creators usually want to know when someone replied to their discussion.Reviewers should focus on:
Would you consider including this in the core extension? Or should it be extended using another extension, as shown in my extension: https://discuss.flarum.org/d/34680-auto-follow-discussion
There have also been quite a few discussions on this behavior over the years:
Personally, I would definitely like to see this in core as this is something that should come out of the box.
Screenshot
Necessity
Confirmed
composer test).Required changes: