discourse/spec/services
Martin Brennan e62e93f83a
FEATURE: Introduce personal_message_enabled_groups setting (#18042)
This will replace `enable_personal_messages` and
`min_trust_to_send_messages`, this commit introduces
the setting `personal_message_enabled_groups`
and uses it in all places that `enable_personal_messages`
and `min_trust_to_send_messages` currently apply.

A migration is included to set `personal_message_enabled_groups`
based on the following rules:

* If `enable_personal_messages` was false, then set
  `personal_message_enabled_groups` to `3`, which is
  the staff auto group
* If `min_trust_to_send_messages` is not default (1)
  and the above condition is false, then set the
  `personal_message_enabled_groups` setting to
  the appropriate auto group based on the trust level
* Otherwise just set `personal_message_enabled_groups` to
  11 which is the TL1 auto group

After follow-up PRs to plugins using these old settings, we will be
able to drop the old settings from core, in the meantime I've added
 DEPRECATED notices to their descriptions and added them
to the deprecated site settings list.

This commit also introduces a `_map` shortcut method definition
for all `group_list` site settings, e.g. `SiteSetting.personal_message_enabled_groups`
also has `SiteSetting.personal_message_enabled_groups_map` available,
which automatically splits the setting by `|` and converts it into
an array of integers.
2022-09-26 13:58:40 +10:00
..
notifications Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
anonymous_shadow_creator_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
auto_silence_spec.rb DEV: Use AR enums in reviewables related code 2022-09-22 14:44:27 +02:00
badge_granter_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
base_bookmarkable_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
color_scheme_revisor_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
destroy_task_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
email_settings_exception_handler_spec.rb DEV: Upgrade to Rails 7 2022-04-28 11:51:03 +02:00
email_settings_validator_spec.rb DEV: Upgrade to Rails 7 2022-04-28 11:51:03 +02:00
email_style_updater_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
external_upload_manager_spec.rb DEV: Run some specs with fake S3 implementation instead of stubs 2022-06-28 21:27:52 +02:00
flag_sockpuppets_spec.rb DEV: Use AR enums in reviewables related code 2022-09-22 14:44:27 +02:00
group_action_logger_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
group_mentions_updater_spec.rb DEV: Automatically require 'rails_helper' in all specs (#16077) 2022-03-01 17:50:50 +00:00
group_message_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
heat_settings_updater_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
inline_uploads_multisite_spec.rb FIX: Maintain HTML `<img` when downloading remote images (#16278) 2022-03-29 10:55:10 +01:00
inline_uploads_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
notification_emailer_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
post_action_notifier_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
post_alerter_spec.rb DEV: Use AR enums in reviewables related code 2022-09-22 14:44:27 +02:00
post_bookmarkable_spec.rb DEV: Guardians aren't active record objects, so shouldn't use fab! (#17789) 2022-08-03 19:17:40 -05:00
post_owner_changer_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
push_notification_pusher_spec.rb FIX: fallback to default push notification icon if none exists (#16961) 2022-06-01 12:00:05 +10:00
random_topic_selector_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
search_indexer_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
site_settings_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
staff_action_logger_spec.rb FIX: Restore trust level when leaving group (#17954) 2022-08-29 13:00:48 +03:00
themes_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
topic_bookmarkable_spec.rb DEV: Guardians aren't active record objects, so shouldn't use fab! (#17789) 2022-08-03 19:17:40 -05:00
topic_status_updater_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
topic_timestamp_changer_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
trust_level_granter_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
user_activator_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
user_anonymizer_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
user_authenticator_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
user_destroyer_spec.rb DEV: Use AR enums in reviewables related code 2022-09-22 14:44:27 +02:00
user_merger_spec.rb FEATURE: Introduce personal_message_enabled_groups setting (#18042) 2022-09-26 13:58:40 +10:00
user_notification_schedule_processor_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
user_silencer_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
user_stat_count_updater_spec.rb Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
user_updater_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
username_changer_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
username_checker_service_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
wildcard_domain_checker_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
wildcard_url_checker_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
word_watcher_spec.rb DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00