canBlockUser

fun canBlockUser(blockUserEnabled: Boolean, currentUser: User?, message: Message): Boolean

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

A user can be blocked when:

  • Block user functionality is enabled in the UI configuration

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

Return

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

Parameters

blockUserEnabled

Whether the block user feature is enabled in the UI.

currentUser

The currently authenticated user.

message

The message whose sender to check for block eligibility.