interface ChatDomain
The ChatDomain is the main entry point for all livedata & offline operations on chat
Use cases are exposed via chatDomain.useCases
Builder |
data class Builder |
banned |
if the current user is banned or not abstract val banned: LiveData<Boolean> |
channelUnreadCount |
the number of unread channels for the current user abstract val channelUnreadCount: LiveData<Int> |
currentUser |
The current user object abstract var currentUser: User |
errorEvents |
The error event livedata object is triggered when errors in the underlying components occure. The following example shows how to observe these errors abstract val errorEvents: LiveData<Event<ChatError>> |
initialized |
if the client connection has been initialized abstract val initialized: LiveData<Boolean> |
muted |
list of users that you've muted abstract val muted: LiveData<List<Mute>> |
offlineEnabled |
if offline is enabled abstract var offlineEnabled: Boolean |
online |
LiveData that indicates if we are currently online abstract val online: LiveData<Boolean> |
retryPolicy |
The retry policy for retrying failed requests abstract var retryPolicy: RetryPolicy |
totalUnreadCount |
The total unread message count for the current user. Depending on your app you'll want to show this or the channelUnreadCount abstract val totalUnreadCount: LiveData<Int> |
useCases |
a helper object which lists all the initialized use cases for the chat domain abstract var useCases: UseCaseHelper |
userPresence |
if we want to track user presence abstract var userPresence: Boolean |
clean |
abstract fun clean(): Unit |
disconnect |
abstract suspend fun disconnect(): Unit |
getActiveQueries |
abstract fun getActiveQueries(): List<QueryChannelsControllerImpl> |
getChannelConfig |
abstract fun getChannelConfig(channelType: String): Config |
getVersion |
abstract fun getVersion(): String |
isInitialized |
abstract fun isInitialized(): Boolean |
isOffline |
abstract fun isOffline(): Boolean |
isOnline |
abstract fun isOnline(): Boolean |
instance |
fun instance(): ChatDomain |
ChatDomainImpl |
The Chat Repository exposes livedata objects to make it easier to build your chat UI. It intercepts the various low level events to ensure data stays in sync. Offline storage is handled using Room class ChatDomainImpl : ChatDomain |