-
public interface GlobalStateGlobal state of StatePlugin.
-
-
Method Summary
Modifier and Type Method Description abstract BooleanisOnline()If the user is online or not. abstract BooleanisOffline()If the user is offline or not. abstract BooleanisConnecting()If connection is in connecting state. abstract BooleanisInitialized()If domain state is initialized or not. abstract UnitclearState()Clears the state of GlobalState. abstract StateFlow<User>getUser()The current user in the OfflinePlugin state. abstract StateFlow<Boolean>getInitialized()If the client connection has been initialized. abstract StateFlow<ConnectionState>getConnectionState()StateFlow<ConnectionState> that indicates if we are currently online, connecting of offline. abstract StateFlow<Integer>getTotalUnreadCount()The total unread message count for the current user. abstract StateFlow<Integer>getChannelUnreadCount()the number of unread channels for the current user. abstract StateFlow<Event<ChatError>>getErrorEvents()The error event state flow object is triggered when errors in the underlying components occur. abstract StateFlow<List<Mute>>getMuted()list of users that you've muted. abstract StateFlow<List<ChannelMute>>getChannelMutes()List of channels you've muted. abstract StateFlow<Boolean>getBanned()if the current user is banned or not. abstract StateFlow<TypingEvent>getTypingUpdates()Updates about currently typing users in active channels. abstract StateFlow<Map<String, TypingEvent>>getTypingChannels()Map of typing users in all active channel. -
-
Method Detail
-
isOnline
@Deprecated(message = Use ClientState.isOnline() instead., replaceWith = @ReplaceWith(imports = {io.getstream.chat.android.client.ChatClient, io.getstream.chat.android.offline.extensions.clientState}, expression = ChatClient.instance().clientState.isOnline)) abstract Boolean isOnline()
If the user is online or not.
-
isOffline
@Deprecated(message = Use ClientState.isOffline() instead., replaceWith = @ReplaceWith(imports = {io.getstream.chat.android.client.ChatClient, io.getstream.chat.android.offline.extensions.clientState}, expression = ChatClient.instance().clientState.isOffline)) abstract Boolean isOffline()
If the user is offline or not.
-
isConnecting
@Deprecated(message = Use ClientState.isConnecting() instead., replaceWith = @ReplaceWith(imports = {io.getstream.chat.android.client.ChatClient, io.getstream.chat.android.offline.extensions.clientState}, expression = ChatClient.instance().clientState.isConnecting)) abstract Boolean isConnecting()
If connection is in connecting state.
-
isInitialized
@Deprecated(message = Use ClientState.isInitialized() instead., replaceWith = @ReplaceWith(imports = {io.getstream.chat.android.client.ChatClient, io.getstream.chat.android.offline.extensions.clientState}, expression = ChatClient.instance().clientState.isInitialized)) abstract Boolean isInitialized()
If domain state is initialized or not.
-
clearState
abstract Unit clearState()
Clears the state of GlobalState.
-
getUser
abstract StateFlow<User> getUser()
The current user in the OfflinePlugin state.
-
getInitialized
abstract StateFlow<Boolean> getInitialized()
If the client connection has been initialized.
-
getConnectionState
abstract StateFlow<ConnectionState> getConnectionState()
StateFlow<ConnectionState> that indicates if we are currently online, connecting of offline.
-
getTotalUnreadCount
abstract StateFlow<Integer> getTotalUnreadCount()
The total unread message count for the current user. Depending on your app you'll want to show this or the channelUnreadCount.
-
getChannelUnreadCount
abstract StateFlow<Integer> getChannelUnreadCount()
the number of unread channels for the current user.
-
getErrorEvents
abstract StateFlow<Event<ChatError>> getErrorEvents()
The error event state flow object is triggered when errors in the underlying components occur. The following example shows how to observe these errors
repo.errorEvent.collect { // create a toast }
-
getChannelMutes
abstract StateFlow<List<ChannelMute>> getChannelMutes()
List of channels you've muted.
-
getTypingUpdates
abstract StateFlow<TypingEvent> getTypingUpdates()
Updates about currently typing users in active channels. See TypingEvent.
-
getTypingChannels
abstract StateFlow<Map<String, TypingEvent>> getTypingChannels()
Map of typing users in all active channel. Use io.getstream.chat.android.client.models.Channel.cid to access events for a particular channel.
-
-
-
-