-
- All Implemented Interfaces:
-
io.getstream.chat.android.offline.plugin.state.global.GlobalState,io.getstream.chat.android.offline.plugin.state.global.internal.MutableGlobalState
public final class GlobalMutableState implements MutableGlobalState
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classGlobalMutableState.Companion
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<Integer>totalUnreadCountprivate final StateFlow<Integer>channelUnreadCountprivate final StateFlow<List<Mute>>mutedprivate final StateFlow<List<ChannelMute>>channelMutesprivate final StateFlow<Boolean>bannedprivate final StateFlow<Map<String, TypingEvent>>typingChannelsprivate final ClientStateclientState
-
Method Summary
Modifier and Type Method Description StateFlow<Integer>getTotalUnreadCount()The total unread message count for the current user. StateFlow<Integer>getChannelUnreadCount()the number of unread channels for the current user. StateFlow<List<Mute>>getMuted()list of users that you've muted. StateFlow<List<ChannelMute>>getChannelMutes()List of channels you've muted. StateFlow<Boolean>getBanned()if the current user is banned or not. StateFlow<Map<String, TypingEvent>>getTypingChannels()Map of typing users in all active channel. ClientStategetClientState()UnitclearState()Clears the state of GlobalState. UnitsetTotalUnreadCount(Integer totalUnreadCount)UnitsetChannelUnreadCount(Integer channelUnreadCount)UnitsetBanned(Boolean banned)UnitsetChannelMutes(List<ChannelMute> channelMutes)UnitsetMutedUsers(List<Mute> mutedUsers)UnittryEmitTypingEvent(String cid, TypingEvent typingEvent)Tries emit typing event for a particular channel. -
-
Method Detail
-
getTotalUnreadCount
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
StateFlow<Integer> getChannelUnreadCount()
the number of unread channels for the current user.
-
getChannelMutes
StateFlow<List<ChannelMute>> getChannelMutes()
List of channels you've muted.
-
getTypingChannels
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.
-
getClientState
ClientState getClientState()
-
clearState
Unit clearState()
Clears the state of GlobalState.
-
setTotalUnreadCount
Unit setTotalUnreadCount(Integer totalUnreadCount)
-
setChannelUnreadCount
Unit setChannelUnreadCount(Integer channelUnreadCount)
-
setChannelMutes
Unit setChannelMutes(List<ChannelMute> channelMutes)
-
setMutedUsers
Unit setMutedUsers(List<Mute> mutedUsers)
-
tryEmitTypingEvent
Unit tryEmitTypingEvent(String cid, TypingEvent typingEvent)
Tries emit typing event for a particular channel.
- Parameters:
cid- The full channel id, i.e.typingEvent- TypingEvent with information about typing users.
-
-
-
-