Overview
Returns an async function that soft-deletes a message. The message is removed from the local Redux store immediately. On the server, the message’s content is cleared anduserDeletedAt is set — the record is retained for threading consistency.
Requires
ChatProvider in the component tree.Usage Example
Parameters
The hook returns a function. That function accepts:The ID of the conversation that contains the message.
The ID of the message to delete.
Returns
Promise<void>
Notes
- Other participants see the deletion in real-time via the
message:deletedsocket event, which is handled automatically byChatProvider. Their local copy of the message will haveuserDeletedAtset andcontent: null. - For integration guidance, see Chat: Messages.

