-
public final class MessageComposerCapabilitiesKt
-
-
Method Summary
Modifier and Type Method Description final static BooleancanSendMessage(MessageComposerState $self)Determines whether the user can send a message in the current state. final static BooleancanUploadFile(MessageComposerState $self)Determines whether the user can upload files in the current state. -
-
Method Detail
-
canSendMessage
final static Boolean canSendMessage(MessageComposerState $self)
Determines whether the user can send a message in the current state.
This function checks both channel-level capabilities and user preferences to determine if a message can be sent. The required capability depends on the current message mode:
In thread mode: requires ChannelCapabilities.SEND_REPLY capability
In regular mode: requires ChannelCapabilities.SEND_MESSAGE capability
The final decision also considers the MessageComposerState.sendEnabled flag, which allows temporary disabling of sending (e.g., while uploading attachments or validating input).
-
canUploadFile
final static Boolean canUploadFile(MessageComposerState $self)
Determines whether the user can upload files in the current state.
This function checks if the user has the ChannelCapabilities.UPLOAD_FILE capability for the current channel. This capability allows users to attach and upload files (documents, images, videos, etc.) through the message composer.
-
-
-
-