feat: Block all email sending actions when an administrator has disabled the permission#2896
Merged
Merged
Conversation
530e560 to
22dee0c
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds initial support for the new mailbox-level can_send_emails permission so the app can block compose/reply entry points when an administrator disables sending. It spans persisted mailbox permissions, notification actions, and multiple send-related UI surfaces across the main thread and compose flows.
Changes:
- Add and persist
MailboxPermissions.canSendEmails, including a mailbox-info schema bump. - Disable or restyle send/reply affordances in thread views, action sheets, the compose entry point, and mailbox selection.
- Remove notification reply actions and redirect blocked compose launches back to
MainActivitywith a snackbar.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/res/layout/view_main_actions.xml | Updates main action buttons/text to use disabled-aware color selectors. |
| app/src/main/res/layout/item_bottom_sheet_action.xml | Updates bottom-sheet action icon/text colors for disabled states. |
| app/src/main/res/color/information_block_background_disabled.xml | Adds a disabled-aware background tint selector. |
| app/src/main/java/com/infomaniak/mail/views/BottomQuickActionBarView.kt | Adds lookup-based disabling for quick-action menu items. |
| app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt | Conditionally removes the notification Reply action based on mailbox permissions. |
| app/src/main/java/com/infomaniak/mail/utils/extensions/ViewExt.kt | Adds shared helpers to bind blocked-sending click behavior and disabled styling. |
| app/src/main/java/com/infomaniak/mail/ui/newMessage/selectMailbox/SelectMailboxViewModel.kt | Propagates canSendEmails into mailbox-selection UI models. |
| app/src/main/java/com/infomaniak/mail/ui/newMessage/selectMailbox/SelectMailboxScreen.kt | Disables the Continue button when the selected mailbox cannot send. |
| app/src/main/java/com/infomaniak/mail/ui/newMessage/selectMailbox/compose/AccountMailboxesDropdown.kt | Disables blocked mailboxes in the Compose mailbox dropdown. |
| app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageViewModel.kt | Adds a helper to decide whether composing is allowed. |
| app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageActivity.kt | Changes compose start-destination logic and redirects blocked launches to MainActivity. |
| app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt | Exposes current-mailbox send permission as LiveData and a convenience property. |
| app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt | Blocks compose navigation when sending is disabled and shows the admin-disabled snackbar. |
| app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadFragment.kt | Hooks mailbox permissions into thread UI and quick actions. |
| app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadAdapter.kt | Tracks send permission in the adapter and disables per-message reply UI. |
| app/src/main/java/com/infomaniak/mail/ui/main/thread/DetailedContactBottomSheetDialog.kt | Disables the “write mail” contact action when sending is blocked. |
| app/src/main/java/com/infomaniak/mail/ui/main/thread/actions/MainActionsView.kt | Adds menu-id based disabling for the main thread action strip. |
| app/src/main/java/com/infomaniak/mail/ui/main/thread/actions/MailActionsBottomSheetDialog.kt | Disables reply/forward/reaction actions in the mail actions bottom sheet. |
| app/src/main/java/com/infomaniak/mail/ui/main/thread/actions/ActionItemView.kt | Propagates enabled/disabled state to inner views for proper styling. |
| app/src/main/java/com/infomaniak/mail/ui/main/folder/ThreadListFragment.kt | Binds the new-message FAB to mailbox send permissions. |
| app/src/main/java/com/infomaniak/mail/data/models/mailbox/MailboxPermissions.kt | Adds the serialized can_send_emails permission field. |
| app/src/main/java/com/infomaniak/mail/data/cache/RealmDatabase.kt | Bumps mailbox-info schema version for the new permission field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1b06e21 to
24cc00c
Compare
b7052e1 to
17b152f
Compare
2af4a3e to
62cd960
Compare
2d5a375 to
3b77c14
Compare
3a9d2ac to
7dfb8e5
Compare
98bc3e7 to
80fc3bb
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



V0 #2890
Here V1