canMuteUser

fun canMuteUser(muteUserEnabled: Boolean, currentUser: User?, message: Message, channel: Channel): Boolean

Determines whether the user who sent the given message can be muted.

A user can be muted when:

  • Mute user functionality is enabled in the UI configuration

  • Muting is enabled in the channel configuration

  • The message was not sent by the current user (users cannot mute themselves)

Return

true if the message sender can be muted, false otherwise.

Parameters

muteUserEnabled

Whether the mute user feature is enabled in the UI.

currentUser

The currently authenticated user.

message

The message whose sender to check for mute eligibility.

channel

The channel where the message was sent.