feat: add confirmation dialog when using @all or @here mentions
Β
KU
2mo ago+127+127+012345678901234567890123456789-8-8-0123456789
Description
Implements a confirmation dialog when a user types @all or @here in a message, prompting them before notifying all channel members.
Closes #909
Changes
New admin settings (Admin -> Message):
- Ask for confirmation when using @all or @here mentions (
Message_ConfirmGroupMentions, boolean, default:true) -- enables/disables the feature -
- Minimum members to trigger @all/@here confirmation (
Message_ConfirmGroupMentions_MinMembers, int, default:10) -- only shows the dialog if the room has at least this many members
- Minimum members to trigger @all/@here confirmation (
New flow: processGroupMentionConfirmation
- Detects
@all/@herein the message text -
- Reads
room.usersCountfrom local state (no extra API call)
- Reads
-
- If threshold is met, shows a warning
GenericModalasking the user to confirm
- If threshold is met, shows a warning
-
- Send anyway -> message is sent; Cancel -> composer text is restored
Integration
- Hooked into
sendMessage.tsafterprocessTooLongMessage, before slash commands
Screenshots
Modal appearing when sending @all in a 6-member channel:
"Notify all members? -- This message will notify all 6 members of this channel. Are you sure you want to proceed?"
Type of change
- New feature (non-breaking change which adds functionality)
Summary by CodeRabbit
- New Features
- Added confirmation prompts before sending messages containing
@allor@herein larger rooms. - Users can review the warning, send the message, or cancel and continue editing.
- Added settings to enable or disable confirmations and configure the minimum room size that triggers them.
- Added confirmation prompts before sending messages containing
- Localization
- Added English text for confirmation dialogs, actions, member counts, and configuration options.