Continuing the discussion from Make members of a group watch a category by default: (splitting out from this topic, because it’s quite old, there’s a bit of noise, and I really want this.)
We have the need to set the default notification settings of groups on our Discourse instance within Mozilla, and I’d like to build the feature upstream because it seems like its something a number of users could benefit from.
I see this being implemented in much the same way that default category notification settings can be set globally, with 4 fields like the following added to the group admin page:
Along with a drop-down specifying how these should interact with user preferences:
And a “message users when their notification levels change” option.
Where multiple groups set defaults on the same category, the higher level of notification should always take priority, as follows: muted < tracking < watching first post < watching
.
If the user override preference is set to never:
-
Users can’t change their notification level
-
When a user joins a group with category notification defaults specified, these will be applied.
-
When a user leaves the group, the applied category notification defaults will be reverted to the settings the user had before joining.
-
If the category notification defaults change while a user is in a group, they will be applied/reverted for existing users.
If the user override preference is set to if higher level:
-
Users can set their notification level to a higher priority.
-
will happen unless the user has a higher level of notification already set
-
will happen unless the user has changed their notification level while in the group
-
will happen unless the user has set a notification level higher than the new group default
If the user override preference is set to always:
-
Users can set their notification level to anything
-
will happen unless the user already has a notification level set
-
will happen unless the user has changed their notification level while in the group
-
will happen unless the user has changed their notification level
With “message users when their notification levels change” enabled, a user will be messaged by the system user when they join/leave a group or the group defaults get changed, letting them know what the defaults for the group are, and whether they’ve been applied/reverted in their case or not.
In terms of how this will be achieved technically, a boolean from_group_defaults
column can be added to the category_users
table, which is true
when a users’ category notification level has been set by being a member of a group. This should provide enough information to make the above logic work.