Decides when a chat message can be sent and how its text is shown, for the chat modal's composer, edit box and message rows.

Functions

f
messageTextClass(body: string): string

Returns the class for the text of a sent or pending message. A message of nothing but a few emoji gets the one that shows it large.

f
sendable(draft: string): boolean

Checks whether draft can be sent or saved. Like the server, it measures the trimmed text.

f
snippet(body: string): string

Returns body as one line of plain text, for the reply bar above the composer and the reply line above a message.

Variables

v
COUNT_FROM: 1800

The length from which the composer and the edit box show their character counter, near VALIDATION.CHAT_MESSAGE_MAX.