-
public final class ChannelInfoViewControllerController responsible for managing the state and events related to channel information.
It provides functionality to observe channel data, members, and perform various channel-related actions such as renaming, muting, leaving, and deleting the channel. It also handles state updates and emits events for UI consumption.
-
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<ChannelInfoViewState>stateprivate final SharedFlow<ChannelInfoViewEvent>events
-
Constructor Summary
Constructors Constructor Description ChannelInfoViewController(String cid, CoroutineScope scope, Function1<ChannelInfoViewState.Content.Option, Boolean> optionFilter, ChatClient chatClient, Flow<ChannelState> channelState, ChannelClient channelClient, Flow<GlobalState> globalState)
-
Method Summary
Modifier and Type Method Description final StateFlow<ChannelInfoViewState>getState()A StateFlow representing the current state of the channel info. final SharedFlow<ChannelInfoViewEvent>getEvents()A SharedFlow that emits one-shot events related to channel info, such as errors or success events. final UnitonViewAction(ChannelInfoViewAction action)Handles actions related to channel information view. final UnitaddMembers(Set<String> userIds)Adds the given members to the channel. final UnitonMemberViewEvent(ChannelInfoMemberViewEvent event)Propagates events from the ChannelInfoMemberViewEvent to the ChannelInfoViewEvent. -
-
Constructor Detail
-
ChannelInfoViewController
ChannelInfoViewController(String cid, CoroutineScope scope, Function1<ChannelInfoViewState.Content.Option, Boolean> optionFilter, ChatClient chatClient, Flow<ChannelState> channelState, ChannelClient channelClient, Flow<GlobalState> globalState)
- Parameters:
cid- The unique identifier of the channel.scope- The CoroutineScope used for launching coroutines.optionFilter- A filter function for channel options, allowing customization of which options are displayed.chatClient- The ChatClient instance used for interacting with the chat API.channelState- A Flow representing the state of the channel.channelClient- The ChannelClient instance for performing channel-specific operations.
-
-
Method Detail
-
getState
final StateFlow<ChannelInfoViewState> getState()
A StateFlow representing the current state of the channel info.
-
getEvents
final SharedFlow<ChannelInfoViewEvent> getEvents()
A SharedFlow that emits one-shot events related to channel info, such as errors or success events.
-
onViewAction
final Unit onViewAction(ChannelInfoViewAction action)
Handles actions related to channel information view.
- Parameters:
action- The ChannelInfoViewAction representing the action to be handled.
-
addMembers
final Unit addMembers(Set<String> userIds)
Adds the given members to the channel.
- Parameters:
userIds- The set of user IDs to add as members.
-
onMemberViewEvent
final Unit onMemberViewEvent(ChannelInfoMemberViewEvent event)
Propagates events from the ChannelInfoMemberViewEvent to the ChannelInfoViewEvent.
-
-
-
-