buildDefaultChannelActions

fun buildDefaultChannelActions(selectedChannel: Channel, ownCapabilities: Set<String>, viewModel: ChannelListViewModel, onViewInfoAction: (Channel) -> Unit): List<ChannelAction>

Builds the default list of channel actions, based on the current user permissions and channel state. Each action is self-describing and carries its icon, label, and execution handler.

Actions vary by channel type:

  • DM: View Info, Pin/Unpin Chat, Mute/Unmute User, Block/Unblock User, Archive/Unarchive Chat, Delete Chat

  • Group (owner): View Info, Pin/Unpin Chat, Archive/Unarchive Chat, Leave Group, Delete Group

  • Group (member): View Info, Pin/Unpin Chat, Archive/Unarchive Chat, Leave Group

Pin and Archive actions are opt-in via ChannelOptionsVisibility.isPinChannelVisible and ChannelOptionsVisibility.isArchiveChannelVisible respectively.

Return

The list of channel actions to display.

Parameters

selectedChannel

The currently selected channel.

ownCapabilities

Set of capabilities the user is given for the current channel.

viewModel

The ChannelListViewModel to bind action handlers to.

onViewInfoAction

Handler invoked when the user selects the "View Info" action.


fun buildDefaultChannelActions(selectedChannel: Channel, isMuted: Boolean, ownCapabilities: Set<String>, viewModel: ChannelListViewModel, onViewInfoAction: (Channel) -> Unit): List<ChannelAction>

Deprecated

The isMuted parameter is unused and will be removed in a future release.

Replace with

buildDefaultChannelActions(selectedChannel, ownCapabilities, viewModel, onViewInfoAction)

Deprecated overload that forwarded an isMuted argument never read by the action builders. Use the overload without isMuted instead.

Return

The list of channel actions to display.

Parameters

selectedChannel

The currently selected channel.

isMuted

Unused. Kept for source compatibility; the value is ignored.

ownCapabilities

Set of capabilities the user is given for the current channel.

viewModel

The ChannelListViewModel to bind action handlers to.

onViewInfoAction

Handler invoked when the user selects the "View Info" action.