You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request introduces an opt-in mechanism for platform members to
receive direct messages, tightening permissions around who can be added
as participants in new or updated conversations. It centralizes
participant permission logic, updates error handling and feedback, and
adds localization for new messaging rules. The changes affect controller
logic, model preferences, policy enforcement, user interface, and
translations, ensuring members have explicit control over their
messaging privacy.
**Messaging Permissions & Participant Filtering:**
* Added a `receive_messages_from_members` preference to
`BetterTogether::Person`, defaulting to false, allowing members to opt
in to receive messages from non-managers.
* Centralized participant permission logic in
`ConversationPolicy#permitted_participants`, restricting regular members
to only message platform managers or opted-in members.
* Updated controller logic in `ConversationsController#create` and
`#update` to filter participant IDs using the new policy and provide
error feedback if only disallowed participants are submitted.
[[1]](diffhunk://#diff-6b6a5b6094bf58416efbcacae28ee7f545bd56152102b55f2c10441efd0b0cd1L28-R54)
[[2]](diffhunk://#diff-6b6a5b6094bf58416efbcacae28ee7f545bd56152102b55f2c10441efd0b0cd1L48-R107)
[[3]](diffhunk://#diff-6b6a5b6094bf58416efbcacae28ee7f545bd56152102b55f2c10441efd0b0cd1L150-R230)
[[4]](diffhunk://#diff-6b6a5b6094bf58416efbcacae28ee7f545bd56152102b55f2c10441efd0b0cd1L181-R246)
**User Interface & Feedback:**
* Added toggle switch to the person form for opting in to receive
messages from platform members, with explanatory text.
* Improved error display in the conversation form and added conditional
messaging button to person profiles based on permissions.
[[1]](diffhunk://#diff-d60c0c0b5850cdcc8d34927696501c783d1131819557241680c537bc15009b21L2-R4)
[[2]](diffhunk://#diff-f8131ad40c5e33f27d8e421b69d10a7b8bb421c5b60311a8158df354bdfbabedR35-R40)
**Localization & Error Messaging:**
* Added error messages and hints in English, Spanish, and French for
cases where no permitted participants are available, and for the new
opt-in feature.
[[1]](diffhunk://#diff-44438ce218f5287c58d0017f965d888715635d94280669896f75841fbd7b4cd7R716-R718)
[[2]](diffhunk://#diff-44438ce218f5287c58d0017f965d888715635d94280669896f75841fbd7b4cd7R1193)
[[3]](diffhunk://#diff-44438ce218f5287c58d0017f965d888715635d94280669896f75841fbd7b4cd7R1404-R1407)
[[4]](diffhunk://#diff-44438ce218f5287c58d0017f965d888715635d94280669896f75841fbd7b4cd7R1797)
[[5]](diffhunk://#diff-44438ce218f5287c58d0017f965d888715635d94280669896f75841fbd7b4cd7R1840-R1841)
[[6]](diffhunk://#diff-4bbf4ee302c9607c80408361708b8b9fde3ee7afc5b505bfd69d429dd433f915R719-R721)
[[7]](diffhunk://#diff-4bbf4ee302c9607c80408361708b8b9fde3ee7afc5b505bfd69d429dd433f915R1197)
[[8]](diffhunk://#diff-4bbf4ee302c9607c80408361708b8b9fde3ee7afc5b505bfd69d429dd433f915R1412-R1415)
[[9]](diffhunk://#diff-4bbf4ee302c9607c80408361708b8b9fde3ee7afc5b505bfd69d429dd433f915R1792)
[[10]](diffhunk://#diff-4bbf4ee302c9607c80408361708b8b9fde3ee7afc5b505bfd69d429dd433f915R1836-R1837)
[[11]](diffhunk://#diff-2c5ab6165f7efe573a84107e0e51102ad47cefb0c65629759d7458eee14326e7R724-R726)
[[12]](diffhunk://#diff-2c5ab6165f7efe573a84107e0e51102ad47cefb0c65629759d7458eee14326e7R1203)
[[13]](diffhunk://#diff-2c5ab6165f7efe573a84107e0e51102ad47cefb0c65629759d7458eee14326e7R1421-R1424)
[[14]](diffhunk://#diff-2c5ab6165f7efe573a84107e0e51102ad47cefb0c65629759d7458eee14326e7R1824)
[[15]](diffhunk://#diff-2c5ab6165f7efe573a84107e0e51102ad47cefb0c65629759d7458eee14326e7R1868-R1869)
**Testing:**
* Added model and policy specs to verify opt-in preference behavior and
participant filtering.
[[1]](diffhunk://#diff-3d46edd17462b82a6311eda5d720295228aca57aceb70d33513f87fa7e0c90d3R1-R16)
[[2]](diffhunk://#diff-1d3db2f8c3a004bd5b4eb7c0deb75d92c8e5990f471dc6a43d7abfdac9bed667R1-R41)
0 commit comments