canEditMessage

fun canEditMessage(editMessageEnabled: Boolean, currentUser: User?, message: Message, ownCapabilities: Set<String>): Boolean

Determines whether the given message can be edited.

A message can be edited when:

  • Edit message functionality is enabled in the UI configuration

  • The user has permission to edit their own messages and it's their message, OR they can edit any message

  • The message is not a Giphy command

  • The message does not contain a shared location attachment

Return

true if the message can be edited, false otherwise.

Parameters

editMessageEnabled

Whether the edit message feature is enabled in the UI.

currentUser

The currently authenticated user.

message

The message to check for edit eligibility.

ownCapabilities

The set of capabilities the current user has in the channel.