-
public final class StateRegistryRegistry of all state objects exposed in the offline plugin. This class should have only one instance for the SDK.
-
-
Constructor Summary
Constructors Constructor Description StateRegistry(StateFlow<User> userStateFlow, StateFlow<Map<String, User>> latestUsers, StateFlow<List<Location>> activeLiveLocations, Job job, Function0<Long> now, CoroutineScope scope, MessageLimitConfig messageLimitConfig, StateFlow<List<Mute>> mutedUsers, Boolean useLegacyChannelState, Boolean isLocalUnreadCountEnabled)StateRegistry(StateFlow<User> userStateFlow, StateFlow<Map<String, User>> latestUsers, StateFlow<List<Location>> activeLiveLocations, Job job, Function0<Long> now, CoroutineScope scope, MessageLimitConfig messageLimitConfig, StateFlow<List<Mute>> mutedUsers, Boolean useLegacyChannelState)StateRegistry(StateFlow<User> userStateFlow, StateFlow<Map<String, User>> latestUsers, StateFlow<List<Location>> activeLiveLocations, Job job, Function0<Long> now, CoroutineScope scope, MessageLimitConfig messageLimitConfig, StateFlow<List<Mute>> mutedUsers)StateRegistry(StateFlow<User> userStateFlow, StateFlow<Map<String, User>> latestUsers, StateFlow<List<Location>> activeLiveLocations, Job job, Function0<Long> now, CoroutineScope scope, MessageLimitConfig messageLimitConfig)
-
Method Summary
Modifier and Type Method Description final QueryChannelsStatequeryChannels(FilterObject filter, QuerySorter<Channel> sort)Returns QueryChannelsState associated with particular filter and sort. final QueryChannelsStatequeryChannels(QueryChannelsIdentifier identifier)Returns QueryChannelsState associated with the given identifier. final ChannelStatechannel(String channelType, String channelId)Returns the ChannelState for the given channel. final ThreadStatethread(String messageId)Returns ThreadState of thread replies with parent message that has id equal to messageId. final Unitclear()Clear state of all state objects. -
-
Constructor Detail
-
StateRegistry
StateRegistry(StateFlow<User> userStateFlow, StateFlow<Map<String, User>> latestUsers, StateFlow<List<Location>> activeLiveLocations, Job job, Function0<Long> now, CoroutineScope scope, MessageLimitConfig messageLimitConfig, StateFlow<List<Mute>> mutedUsers, Boolean useLegacyChannelState, Boolean isLocalUnreadCountEnabled)
- Parameters:
userStateFlow- The state flow that provides the user once it is set.latestUsers- Latest users of the SDK.activeLiveLocations- Latest live locations of the SDK.job- A background job cancelled after calling clear.scope- A scope for new coroutines.messageLimitConfig- Configuration for message limits.mutedUsers- The current list of muted users.useLegacyChannelState- Whether to use the legacy channel state implementation.isLocalUnreadCountEnabled- Whether the per-channel unread count is tracked on-device for channels with server-side read events disabled.
-
StateRegistry
StateRegistry(StateFlow<User> userStateFlow, StateFlow<Map<String, User>> latestUsers, StateFlow<List<Location>> activeLiveLocations, Job job, Function0<Long> now, CoroutineScope scope, MessageLimitConfig messageLimitConfig, StateFlow<List<Mute>> mutedUsers, Boolean useLegacyChannelState)
- Parameters:
userStateFlow- The state flow that provides the user once it is set.latestUsers- Latest users of the SDK.activeLiveLocations- Latest live locations of the SDK.job- A background job cancelled after calling clear.scope- A scope for new coroutines.messageLimitConfig- Configuration for message limits.mutedUsers- The current list of muted users.useLegacyChannelState- Whether to use the legacy channel state implementation.
-
StateRegistry
StateRegistry(StateFlow<User> userStateFlow, StateFlow<Map<String, User>> latestUsers, StateFlow<List<Location>> activeLiveLocations, Job job, Function0<Long> now, CoroutineScope scope, MessageLimitConfig messageLimitConfig, StateFlow<List<Mute>> mutedUsers)
- Parameters:
userStateFlow- The state flow that provides the user once it is set.latestUsers- Latest users of the SDK.activeLiveLocations- Latest live locations of the SDK.job- A background job cancelled after calling clear.scope- A scope for new coroutines.messageLimitConfig- Configuration for message limits.mutedUsers- The current list of muted users.
-
StateRegistry
StateRegistry(StateFlow<User> userStateFlow, StateFlow<Map<String, User>> latestUsers, StateFlow<List<Location>> activeLiveLocations, Job job, Function0<Long> now, CoroutineScope scope, MessageLimitConfig messageLimitConfig)
- Parameters:
userStateFlow- The state flow that provides the user once it is set.latestUsers- Latest users of the SDK.activeLiveLocations- Latest live locations of the SDK.job- A background job cancelled after calling clear.scope- A scope for new coroutines.messageLimitConfig- Configuration for message limits.
-
-
Method Detail
-
queryChannels
final QueryChannelsState queryChannels(FilterObject filter, QuerySorter<Channel> sort)
Returns QueryChannelsState associated with particular filter and sort.
- Parameters:
filter- Filter used to query channels.sort- Sort specification used to query channels.
-
queryChannels
final QueryChannelsState queryChannels(QueryChannelsIdentifier identifier)
Returns QueryChannelsState associated with the given identifier. Canonical lookup that works for standard, predefined-filter, and grouped queries. QueryChannelsMutableState derives its initial filter/sort and spec shape from the identifier itself, so this method is just a registry-cache lookup keyed by identifier identity.
- Parameters:
identifier- The identifier of the QueryChannelsState.
-
channel
final ChannelState channel(String channelType, String channelId)
Returns the ChannelState for the given channel.
A malformed cid yields a fresh, non-cached state so callers still get a non-null object, but the registry won't track it and the state will never receive updates.
- Parameters:
channelType- The channel type.channelId- The channel id.
-
thread
final ThreadState thread(String messageId)
Returns ThreadState of thread replies with parent message that has id equal to messageId.
- Parameters:
messageId- Thread's parent message id.
-
-
-
-