function updateChatMessage
updateChatMessage(
id: string,
body: string,
requestingUserId: string,
canModerate: boolean
): ChatMessage

Replaces a message's body on a chat_edit, and claims any image the new body links to. canModerate lets a moderator edit anyone's message. The flag mentionsEveryone is set again from the new body and the author's role, not the editor's: a moderator's edit can't make a user's message reach everyone. The caller broadcasts the result.

Parameters

id: string
body: string
requestingUserId: string
canModerate: boolean

Return Type

Throws

APIException

404 when there is no such message, 403 when the user is neither its author nor a moderator, 400 when the body is blank or too long.

Usage

import { updateChatMessage } from "api/services/chat-service.ts";