-
public interface ChatDomainThe ChatDomain is the main entry point for all livedata & offline operations on chat
Use cases are exposed via chatDomain.useCases
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classChatDomain.Builderpublic classChatDomain.Companion
-
Method Summary
Modifier and Type Method Description abstract Unitdisconnect()abstract BooleanisOnline()abstract BooleanisOffline()abstract BooleanisInitialized()abstract List<QueryChannelsController>getActiveQueries()abstract Unitclean()abstract ConfiggetChannelConfig(String channelType)abstract StringgetVersion()abstract UsergetCurrentUser()the current user on the chatDomain object, same as client. abstract BooleangetOfflineEnabled()if offline is enabled abstract BooleangetUserPresence()if we want to track user presence abstract LiveData<Boolean>getInitialized()if the client connection has been initialized abstract LiveData<Boolean>getOnline()LiveData<Boolean> that indicates if we are currently online abstract LiveData<Integer>getTotalUnreadCount()The total unread message count for the current user. abstract LiveData<Integer>getChannelUnreadCount()the number of unread channels for the current user abstract LiveData<Event<ChatError>>getErrorEvents()The error event livedata object is triggered when errors in the underlying components occure. abstract LiveData<List<Mute>>getMuted()list of users that you've muted abstract LiveData<Boolean>getBanned()if the current user is banned or not abstract RetryPolicygetRetryPolicy()The retry policy for retrying failed requests abstract LiveData<TypingEvent>getTypingUpdates()Updates about currently typing users in active channels. abstract UseCaseHelpergetUseCases()a helper object which lists all the initialized use cases for the chat domain abstract UnitsetCurrentUser(User currentUser)the current user on the chatDomain object, same as client. abstract UnitsetOfflineEnabled(Boolean offlineEnabled)if offline is enabled abstract UnitsetUserPresence(Boolean userPresence)if we want to track user presence abstract UnitsetRetryPolicy(RetryPolicy retryPolicy)The retry policy for retrying failed requests -
-
Method Detail
-
disconnect
abstract Unit disconnect()
-
isInitialized
abstract Boolean isInitialized()
-
getActiveQueries
abstract List<QueryChannelsController> getActiveQueries()
-
getChannelConfig
abstract Config getChannelConfig(String channelType)
-
getVersion
abstract String getVersion()
-
getCurrentUser
abstract User getCurrentUser()
the current user on the chatDomain object, same as client.getCurrentUser()
-
getOfflineEnabled
abstract Boolean getOfflineEnabled()
if offline is enabled
-
getUserPresence
abstract Boolean getUserPresence()
if we want to track user presence
-
getInitialized
abstract LiveData<Boolean> getInitialized()
if the client connection has been initialized
-
getOnline
abstract LiveData<Boolean> getOnline()
LiveData<Boolean> that indicates if we are currently online
-
getTotalUnreadCount
abstract LiveData<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 LiveData<Integer> getChannelUnreadCount()
the number of unread channels for the current user
-
getErrorEvents
abstract LiveData<Event<ChatError>> getErrorEvents()
The error event livedata object is triggered when errors in the underlying components occure. The following example shows how to observe these errors
repo.errorEvent.observe(this, EventObserver { // create a toast })
-
getRetryPolicy
abstract RetryPolicy getRetryPolicy()
The retry policy for retrying failed requests
-
getTypingUpdates
abstract LiveData<TypingEvent> getTypingUpdates()
Updates about currently typing users in active channels. See TypingEvent.
-
getUseCases
abstract UseCaseHelper getUseCases()
a helper object which lists all the initialized use cases for the chat domain
-
setCurrentUser
abstract Unit setCurrentUser(User currentUser)
the current user on the chatDomain object, same as client.getCurrentUser()
-
setOfflineEnabled
abstract Unit setOfflineEnabled(Boolean offlineEnabled)
if offline is enabled
-
setUserPresence
abstract Unit setUserPresence(Boolean userPresence)
if we want to track user presence
-
setRetryPolicy
abstract Unit setRetryPolicy(RetryPolicy retryPolicy)
The retry policy for retrying failed requests
-
-
-
-