Documentation Index Fetch the complete documentation index at: https://mintlify.com/sceyt/sceyt-chat-android-uikit/llms.txt
Use this file to discover all available pages before exploring further.
ChannelInteractor is the primary interface for all channel-level operations in the Sceyt Chat Android UIKit. It is accessible via SceytChatUIKit.chatUIFacade.channelInteractor. All methods are suspend functions unless stated otherwise, and most return either a SceytResponse<T> (for single-result operations) or a Flow<PaginationResponse<SceytChannel>> (for paginated list operations). SceytResponse is a sealed class with Success and Error variants, making exhaustive handling straightforward.
Package: com.sceyt.chatuikit.persistence.interactor
val interactor: ChannelInteractor = SceytChatUIKit.chatUIFacade.channelInteractor
Loading Channels
loadChannels
suspend fun → Flow<PaginationResponse<SceytChannel>>
Loads a paginated list of channels. Results are emitted from the local database first, then updated with the server response. The flow closes when all data has been delivered. interactor. loadChannels (
offset = 0 ,
searchQuery = "" ,
loadKey = LoadKeyData (),
onlyMine = false ,
ignoreDb = false ,
awaitForConnection = false ,
config = ChannelListConfig.default
). collect { response ->
when (response) {
is PaginationResponse.DBResponse -> updateUiFromDb (response. data )
is PaginationResponse.ServerResponse -> updateUiFromServer (response. data )
else -> {}
}
}
Zero-based pagination offset (number of items already loaded).
Text to filter channel subjects. Pass an empty string to load all channels.
A key used to deduplicate in-flight requests and correlate responses; pass null or LoadKeyData() for a fresh load.
When true, only channels where the current user is a member are returned.
When true, skips the local database and fetches directly from the server.
When true, suspends the call until the client is connected before issuing a server request.
config
ChannelListConfig
required
Specifies channel types, sort order, page size, and query parameters. Use ChannelListConfig.default for standard behaviour.
searchChannelsWithUserIds
suspend fun → Flow<PaginationResponse<SceytChannel>>
Searches channels that contain the specified user IDs, optionally also matching a subject query. Useful for finding direct or group channels with specific participants. interactor. searchChannelsWithUserIds (
offset = 0 ,
searchQuery = "" ,
userIds = listOf ( "user-abc" , "user-xyz" ),
config = ChannelListConfig.default,
includeSearchByUserDisplayName = true ,
onlyMine = true ,
ignoreDb = false ,
loadKey = null ,
directChatType = "direct"
). collect { response -> /* handle */ }
Zero-based pagination offset.
Optional subject text filter. Pass an empty string to match any subject.
IDs of users that must be members of the returned channels.
config
ChannelListConfig
required
Channel list configuration (types, order, limit, query params).
includeSearchByUserDisplayName
When true, also matches channels whose members’ display names contain the searchQuery.
When true, restricts results to channels the current user belongs to.
When true, bypasses the local database cache.
Deduplication key for the request.
The channel-type identifier for direct chats. Default: "direct".
getChannelsBySQLiteQuery
suspend fun → List<SceytChannel>
Executes a raw SQLite query against the local channel database. Use for advanced offline filtering not supported by the standard API. val query = SimpleSQLiteQuery ( "SELECT * FROM channels WHERE pinned = 1" )
val pinnedChannels: List < SceytChannel > = interactor. getChannelsBySQLiteQuery (query)
query
SimpleSQLiteQuery
required
A SimpleSQLiteQuery wrapping a raw SQL string with optional bind arguments.
syncChannels
suspend fun → Flow<SyncResult<SceytChannel>>
Forces a full server-side channel sync using the supplied config. Emits SyncResult events as pages of channels are fetched and persisted. interactor. syncChannels (ChannelListConfig.default)
. collect { result -> /* handle sync progress */ }
config
ChannelListConfig
required
Configuration governing which channel types and how many to sync per page.
Read Status
markChannelAsRead
suspend fun → SceytResponse<SceytChannel>
Marks all messages in the channel as read and resets the unread count to zero. when ( val result = interactor. markChannelAsRead (channelId)) {
is SceytResponse.Success -> { /* updated channel in result.data */ }
is SceytResponse.Error -> { /* handle error */ }
}
The numeric ID of the channel to mark as read.
markChannelAsUnRead
suspend fun → SceytResponse<SceytChannel>
Marks the channel as having unread messages, causing it to appear with an unread indicator. The numeric ID of the channel to mark as unread.
History and Deletion
clearHistory
suspend fun → SceytResponse<Long>
Deletes all messages in the channel. Returns the channel ID on success. interactor. clearHistory (channelId = 42L , forEveryone = false )
The numeric ID of the channel whose history to clear.
When true, clears history for all participants; when false, only for the current user.
blockAndLeaveChannel
suspend fun → SceytResponse<Long>
Blocks the channel and removes the current user from it simultaneously. Typically used for direct channels to prevent future messages from that peer. The numeric ID of the channel to block and leave.
unblockChannel
suspend fun → SceytResponse<SceytChannel>
Removes the block on a previously blocked channel. The numeric ID of the channel to unblock.
deleteChannel
suspend fun → SceytResponse<Long>
Permanently deletes the channel and all its messages. The caller must have owner or admin privileges. Returns the deleted channel’s ID on success. The numeric ID of the channel to delete.
leaveChannel
suspend fun → SceytResponse<Long>
Removes the current user from the channel without deleting it. The numeric ID of the channel to leave.
Creating Channels
findOrCreatePendingChannelByMembers
suspend fun → SceytResponse<SceytChannel>
Finds an existing pending channel with the given members, or creates a new one. Used internally for optimistic channel creation before server confirmation. data
CreateChannelData
required
Data object describing the channel to find or create (members, type, metadata, etc.).
findOrCreatePendingChannelByUri
suspend fun → SceytResponse<SceytChannel>
Finds an existing pending channel by URI, or creates a new one with the given URI. data
CreateChannelData
required
Data object including the target URI and channel configuration.
createChannel
suspend fun → SceytResponse<SceytChannel>
Creates a new channel on the server with the provided configuration data. val result = interactor. createChannel (
CreateChannelData (
channelType = "group" ,
subject = "Team Chat" ,
members = listOf (memberData1, memberData2)
)
)
createChannelData
CreateChannelData
required
Describes the channel: type, subject, URI, avatar, metadata, and initial member list.
Muting and Auto-Delete
muteChannel
suspend fun → SceytResponse<SceytChannel>
Mutes notifications for the channel until the specified epoch timestamp in milliseconds. Pass Long.MAX_VALUE to mute indefinitely. interactor. muteChannel (channelId, muteUntil = System. currentTimeMillis () + 3_600_000L )
The numeric ID of the channel to mute.
Unix epoch milliseconds until which the channel remains muted.
unMuteChannel
suspend fun → SceytResponse<SceytChannel>
Re-enables notifications for a previously muted channel. The numeric ID of the channel to unmute.
enableAutoDelete
suspend fun → SceytResponse<SceytChannel>
Enables auto-delete for messages in the channel after the specified period. interactor. enableAutoDelete (channelId, period = 7 .days.inWholeMilliseconds)
The numeric ID of the channel.
Duration in milliseconds after which messages are automatically deleted.
disableAutoDelete
suspend fun → SceytResponse<SceytChannel>
Turns off auto-delete for the channel, retaining all existing messages. The numeric ID of the channel.
Pinning
pinChannel
suspend fun → SceytResponse<SceytChannel>
Pins the channel so it appears at the top of the channel list for the current user. The numeric ID of the channel to pin.
unpinChannel
suspend fun → SceytResponse<SceytChannel>
Removes the pin from a previously pinned channel. The numeric ID of the channel to unpin.
Fetching Channels
getChannelFromDb
suspend fun → SceytChannel?
Returns the channel from the local database, or null if it is not cached. val channel: SceytChannel ? = interactor. getChannelFromDb (channelId)
The numeric ID of the channel to look up.
getChannelsFromDb
suspend fun → List<SceytChannel>
Returns multiple channels from the local database by their IDs. A list of numeric channel IDs to look up.
getDirectChannelFromDb
suspend fun → SceytChannel?
Looks up the direct (1-to-1) channel with the specified peer user from the local database. The user ID of the peer in the direct channel.
getChannelFromServer
suspend fun → SceytResponse<SceytChannel>
Fetches the latest channel data from the server and updates the local database. The numeric ID of the channel to fetch.
getChannelByInviteKey
suspend fun → SceytResponse<SceytChannel>
Looks up a channel using its invite key string. Does not join the channel. The channel invite key (from a deep link, for example).
getChannelFromServerByUri
suspend fun → SceytResponse<SceytChannel?>
Fetches a channel by its public URI from the server. The public URI (handle/slug) of the channel.
Returns the total number of channels stored in the local database. val count: Int = interactor. getChannelsCountFromDb ()
Editing
editChannel
suspend fun → SceytResponse<SceytChannel>
Updates the channel’s subject, description, avatar, metadata, or URI. interactor. editChannel (
channelId = 42L ,
data = EditChannelData (subject = "New Team Name" )
)
The numeric ID of the channel to edit.
Holds the fields to update. Only non-null fields are changed.
Joining
join
suspend fun → SceytResponse<SceytChannel>
Joins the current user to a public channel. The numeric ID of the public channel to join.
joinWithInviteKey
suspend fun → SceytResponse<SceytChannel>
Joins a channel using an invite key, which may be for a private channel. The invite key obtained from a deep link or shared URL.
Hiding
hideChannel
suspend fun → SceytResponse<SceytChannel>
Hides the channel from the channel list without leaving it. The channel reappears when a new message arrives. The numeric ID of the channel to hide.
unHideChannel
suspend fun → SceytResponse<SceytChannel>
Makes a previously hidden channel visible again in the channel list. The numeric ID of the channel to unhide.
Unread Counts and Draft
Returns a hot Flow that emits the total unread message count across channels, optionally filtered by channel type. Emits a new value whenever the count changes. interactor. getTotalUnreadCount (channelTypes = listOf ( "direct" , "group" ))
. onEach { count -> updateBadge (count) }
. launchIn (lifecycleScope)
Channel type identifiers to include in the count. Pass an empty list (default) to count all channel types.
Returns a hot Flow that emits the total number of messages in a specific channel from the local database. The numeric ID of the channel.
Persists a draft message for the channel to the local database. The draft is displayed in the channel list and restored when the user reopens the conversation. interactor. updateDraftMessage (
DraftMessage (channelId = 42L , message = "I was typing this..." )
)
A DraftMessage object containing the channel ID and the draft text (and optional reply/mention data).