Data types
Nested enum types are written with their enclosing class, such as DRException.Source and AndroidChannel.Kind.
This page lists, by area, the returned views, input options, enums and state branches. Business types are in com.deeprespond.im unless noted; the packages of native extensions are given where they apply. The API reference lists the full module signatures that use these types.
Conventions
- Time fields are usually Unix timestamps in milliseconds; RFC 3339 times from the server have been converted to Long. A null field means the value doesn't exist or isn't known, so don't force-unwrap it.
- Durations use
kotlin.time.Durationin Kotlin; Java uses the...Millisfields and theofMillisbuilders. - Read-only views extend DRObject:
raw: JsonObjectkeeps the server's original fields, andrawJson(): Stringreturns them as JSON text. Don't modify them; list items that haven't changed may keep the same object. - The server may add new values to status strings. Enums are only used for closed sets of input values; handle unknown values in responses with a fallback.
- Build JsonObjects with
buildJsonObject. Convenience overloads that takeMap<String, Any?>only accept values that can be converted to JSON. - Cursor paging ends when nextCursor is null; loading / error / hasMore in LiveListSnapshot describe the current window.
Basics, sign-in and diagnostics
DRObject
| Field | Type |
|---|---|
raw | JsonObject |
DRPage
| Field | Type |
|---|---|
items | List<T> |
nextCursor | String? |
AuthState
| Field | Type |
|---|---|
kind | Kind |
Branches (written as AuthState.Name):
data object SignedOut
data object SignedIn
data class Suspended(val code: String, val reason: String?, val retryAt: Long)
data class SessionEnded(val code: String, val reason: String?, val details: JsonObject?)AuthState.Kind: SIGNED_OUT, SIGNED_IN, SUSPENDED, SESSION_ENDED.
SyncModule
Values: CONFIG, ME, FRIENDS, GROUPS, MESSAGES, PUSH, CALLS, CHATROOMS, PRESENCE.
SyncTrigger
Values: PERIODIC, FOREGROUND, FALLBACK, HINT, SYNC_REQUIRED, RECONNECT, LOGIN.
DRConnectionState
| Field | Type |
|---|---|
kind | Kind |
Branches (written as DRConnectionState.Name):
data object Idle
data object Connecting
data object Authenticating
data class Syncing(val pending: List<SyncModule>)
data object Ready
data class Waiting(val retryAt: Long, val lastErrorCode: String?, val lastErrorReason: String?)
data object Offline
data class Paused(val reason: String)
data class Stopped(val code: String, val details: JsonObject?)DRConnectionState.Kind: IDLE, CONNECTING, AUTHENTICATING, SYNCING, READY, WAITING, OFFLINE, PAUSED, STOPPED.
CurrentUser
| Field | Type |
|---|---|
username | String |
sessionId | String |
LoginResult
| Field | Type |
|---|---|
user | SelfProfile |
config | ClientConfig |
sessionId | String |
DisconnectRecord
| Field | Type |
|---|---|
at | Long |
closeCode | Int? |
code | String? |
reason | String? |
FailureRecord
| Field | Type |
|---|---|
at | Long |
op | String |
code | String |
requestId | String? |
Diagnostics
| Field | Type |
|---|---|
sdkVersion | String |
deviceId | String |
sessionId | String? |
connectionId | String? |
connection | DRConnectionState |
loginMethod | String? |
recentDisconnects | List<DisconnectRecord> |
recentFailures | List<FailureRecord> |
lastSyncAt | Map<SyncModule, Long> |
storageMode | StorageMode |
sqlite | SqliteSource |
encrypted | Boolean |
serverTimeOffsetMs | Long |
outboxSize | Int |
extra | Map<String, String> |
pushChannels | List<com.deeprespond.im.push.PushChannel> |
system | SystemState |
SystemState
| Field | Type |
|---|---|
raw | Map<String, String> |
standbyBucket | String? |
backgroundRestricted | Boolean? |
powerSave | Boolean? |
dataSaver | String? |
ignoringBatteryOptimizations | Boolean? |
lowRam | Boolean? |
rom | String? |
build | String? |
targetSdk | Int? |
workProfile | Boolean? |
LiveListSnapshot
| Field | Type |
|---|---|
items | List<T> |
hasMore | Boolean |
loading | Boolean |
error | DRException? |
Users and configuration
ClientConfig
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
version | String |
maxOnlineDevicesPerUser | Int? |
friendCheckEnabled | Boolean |
userBlacklistEnabled | Boolean |
maxGroupMembers | Int? |
clientGroupCreateEnabled | Boolean |
presenceEnabled | Boolean |
presenceScope | String? |
presenceLastSeenVisible | Boolean |
singleReadAckEnabled | Boolean |
groupReadAckEnabled | Boolean |
messageReactionEnabled | Boolean |
maxReactionsPerMessage | Int? |
maxPinnedMessagesPerConversation | Int? |
maxMessageBodyBytes | Long? |
recallWindowSeconds | Int? |
messageRetentionDays | Int? |
pushDefaultPreview | String? |
pushBadgeEnabled | Boolean |
attachmentRetentionDays | Int? |
maxUploadBytes | Long? |
groupFileEnabled | Boolean |
mediaUrlOnly | Boolean |
mediaUrlPrefix | String? |
reportEnabled | Boolean |
clientChatroomCreateEnabled | Boolean |
maxChatroomMessageBytes | Long? |
rtcEnabled | Boolean |
rtcRingTimeoutSeconds | Int? |
maxGroupCallParticipants | Int? |
SelfProfile
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
attributes | Map<String, String>? |
hasPassword | Boolean |
version | Long |
UserProfile
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
attributes | Map<String, String>? |
displayName | String |
LoginSession
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
sessionId | String |
deviceId | String? |
deviceName | String? |
platform | String? |
current | Boolean |
OnlineDevice
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
sessionId | String |
platform | String |
connectedAt | Long? |
current | Boolean |
MyMute
| Field | Type |
|---|---|
chat | GlobalMuteInfo? |
group | GlobalMuteInfo? |
room | GlobalMuteInfo? |
GlobalMuteInfo
| Field | Type |
|---|---|
expiresAt | Long? |
NotifyDecision
| Field | Type |
|---|---|
notify | Boolean |
title | String? |
body | String? |
reason | String? |
Conversations and messages
MessageType
TEXT:"text"IMAGE:"image"VOICE:"voice"VIDEO:"video"FILE:"file"LOCATION:"location"CUSTOM:"custom"TIP:"tip"CALL:"call"
ConversationType
SINGLE:"single"GROUP:"group"
MessageStatus
SENT:"sent"QUEUED:"queued"UPLOADING:"uploading"SENDING:"sending"FAILED:"failed"
Message
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
conversationId | String |
conversationType | String |
seq | Long |
messageId | String |
clientMsgId | String? |
sender | String? |
senderType | String |
recipient | String? |
type | String |
body | JsonObject? |
ext | JsonObject? |
createdAt | Long? |
messageVersion | Long |
MessageLocal
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
status | String |
progress | Double? |
error | DRException? |
statusUnknown | Boolean |
reacted | Map<String, Boolean> |
unsupported | Boolean |
trusted | Boolean |
filePath | String? |
thumbnailPath | String? |
MessageView
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
conversationId | String? |
conversationType | String |
seq | Long? |
messageId | String? |
clientMsgId | String? |
sender | String? |
senderType | String |
recipient | String? |
type | String |
body | JsonObject? |
ext | JsonObject? |
mentions | JsonObject? |
replyTo | JsonObject? |
needReceipt | Boolean |
reactions | List<JsonElement> |
pinned | JsonObject? |
edited | JsonObject? |
recalled | JsonObject? |
erased | Boolean |
via | String |
createdAt | Long? |
messageVersion | Long |
local | MessageLocal |
ConversationState
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
conversationId | String |
conversationType | String |
peer | String? |
groupId | String? |
membership | String? |
startSeq | Long |
maxSeq | Long |
readSeq | Long |
unreadCount | Int |
markedUnread | Boolean |
peerReadSeq | Long? |
mentionSeq | Long? |
clearedSeq | Long |
hiddenSeq | Long |
hidden | Boolean |
pinnedAt | Long? |
joinedAt | Long? |
leftAt | Long? |
messageVersion | Long |
lastMessageAt | Long? |
version | Long |
Draft
class Draft (
val text: String,
val mentionUsernames: List<String>? = null,
val mentionAll: Boolean = false,
val replyToSeq: Long? = null,
val createdAt: Long? = null,
val updatedAt: Long? = null,
)| Field | Type |
|---|---|
text | String |
mentionUsernames | List<String>? |
mentionAll | Boolean |
replyToSeq | Long? |
createdAt | Long? |
updatedAt | Long? |
ConversationView
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
conversationKey | String |
conversationId | String? |
conversationType | String |
peer | String? |
groupId | String? |
state | ConversationState? |
lastMessage | MessageView? |
unreadCount | Int |
draft | Draft? |
muted | MuteInfo? |
typing | List<String> |
MessageGap
| Field | Type |
|---|---|
fromSeq | Long |
toSeq | Long |
kind | String |
PinnedItem
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
seq | Long |
pinnedBy | String? |
pinnedAt | Long? |
message | MessageView? |
ReceiptCount
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
seq | Long |
readCount | Int? |
unreadCount | Int? |
code | String? |
details | JsonObject? |
ReceiptStatus
Values: READ, UNREAD.
OnlineMessage
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
messageId | String |
clientMsgId | String |
conversationType | String |
conversationId | String? |
sender | String? |
senderType | String |
recipient | String? |
groupId | String? |
type | String |
body | JsonObject |
ext | JsonObject? |
via | String |
createdAt | Long? |
OnlineResult
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
messageId | String |
clientMsgId | String |
createdAt | Long? |
onlineOnly | Boolean |
ReactionUser
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String? |
nickname | String? |
avatarUrl | String? |
reactedAt | Long? |
ReceiptUser
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String? |
nickname | String? |
avatarUrl | String? |
LookupResult
| Field | Type |
|---|---|
items | List<MessageView> |
missing | List<Long> |
MarkAllReadResult
| Field | Type |
|---|---|
count | Int |
truncated | Boolean |
MessageListLoading
Values: NONE, INITIAL, OLDER, NEWER.
MessageListSnapshot
| Field | Type |
|---|---|
items | List<MessageView> |
gaps | List<MessageGap> |
hasOlder | Boolean |
hasNewer | Boolean |
loading | MessageListLoading |
pinned | List<PinnedItem> |
error | DRException? |
SendTarget
Branches (written as SendTarget.Name):
data class Conversation(val conversationKey: String)
data class User(val username: String)
data class Group(val groupId: String)OutgoingContent
Besides the JsonObject constructor, Uploaded and Custom also accept Map<String, Any?>; in Java, voice content uses OutgoingContent.voice(file, durationMs). Forward only takes a message view that can be forwarded, and the SDK still checks permissions and content.
Branches (written as OutgoingContent.Name):
data class Text(val text: String)
data class Image(val file: DRFile, val original: Boolean = false)
data class Voice(val file: DRFile, val duration: Duration)
data class Video(val file: DRFile)
data class File(val file: DRFile, val name: String? = null)
data class Uploaded(val type: String, val body: JsonObject)
data class Location(val latitude: Double, val longitude: Double, val name: String? = null, val address: String? = null)
data class Custom(val body: JsonObject)
data class Forward(val message: MessageView)SendOptions
data class SendOptions(
val ext: JsonObject? = null,
val mentionUsernames: List<String>? = null,
val mentionAll: Boolean = false,
val replyToSeq: Long? = null,
val needReceipt: Boolean = false,
val excludeFromUnread: Boolean = false,
val pushDisabled: Boolean? = null,
val waitUntilSent: Boolean = false,
)| Field | Type |
|---|---|
ext | JsonObject? |
mentionUsernames | List<String>? |
mentionAll | Boolean |
replyToSeq | Long? |
needReceipt | Boolean |
excludeFromUnread | Boolean |
pushDisabled | Boolean? |
waitUntilSent | Boolean |
Friends
FriendAddMode
Values: ALLOW_ANY, NEED_CONFIRM, DENY_ANY.
FriendRequestStatus
Values: PENDING, ACCEPTED, DECLINED, EXPIRED.
Friend
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
remark | String |
attributes | Map<String, String>? |
addSource | String |
createdAt | Long? |
displayName | String |
BlacklistEntry
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
createdAt | Long? |
FriendRequest
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
message | String |
addSource | String |
status | FriendRequestStatus? |
unread | Boolean |
remark | String? |
requestedAt | Long? |
expiresAt | Long? |
handledAt | Long? |
FriendCheck
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
isFriend | Boolean |
blocked | Boolean |
request | String? |
FriendListInfo
| Field | Type |
|---|---|
count | Int |
maxCount | Int |
FriendAddSettings
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
friendAddMode | FriendAddMode? |
effectiveFriendAddMode | FriendAddMode? |
FriendRequestResult
| Field | Type |
|---|---|
status | String |
friend | Friend? |
accepted | Boolean |
Groups
GroupRole
Values: OWNER, ADMIN, MEMBER.
GroupType
Values: PRIVATE, PUBLIC.
MemberInvite
Values: FREE, APPROVAL, DISABLED.
JoinMode
Values: APPROVAL, FREE.
GroupRequestKind
Values: APPLICATION, INVITE_REVIEW, INVITATION.
GroupRequestStatus
Values: PENDING, ACCEPTED, DECLINED, CANCELED, EXPIRED.
InviteMode
Values: ALLOW_ANY, NEED_CONFIRM.
GroupSelf
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
role | GroupRole? |
groupNickname | String |
muted | Boolean |
mutedUntil | Long? |
joinedAt | Long? |
GroupInfo
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
groupId | String |
type | String |
name | String |
avatarUrl | String |
description | String? |
announcement | String? |
announcementUpdatedAt | Long? |
announcementUpdatedBy | String? |
attributes | Map<String, String>? |
owner | String? |
memberInvite | String? |
joinMode | String? |
muteAll | Boolean |
maxMembers | Int? |
memberCount | Int |
status | String |
infoVersion | Long? |
memberVersion | Long? |
createdAt | Long? |
self | GroupSelf? |
CreateGroupResult
| Field | Type |
|---|---|
results | List<GroupMemberResult> |
GroupView
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
groupId | String |
group | GroupInfo |
inMyGroups | Boolean |
GroupMember
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
role | GroupRole? |
groupNickname | String |
attributes | Map<String, String>? |
muted | Boolean |
mutedUntil | Long? |
joinedVia | String |
inviter | String? |
joinedAt | Long? |
GroupMemberResult
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
status | String? |
code | String? |
message | String? |
details | JsonObject? |
ok | Boolean |
GroupOnlineCount
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
onlineCount | Int |
countedAt | Long? |
GroupBlacklistEntry
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
reason | String? |
createdBy | String? |
createdByRole | String? |
createdAt | Long? |
JoinLink
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
link | String? |
expiresAt | Long? |
createdBy | String? |
JoinLinkPreview
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
groupId | String |
name | String |
avatarUrl | String |
memberCount | Int |
isMember | Boolean |
GroupRequestUser
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
GroupBrief
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
groupId | String |
name | String |
avatarUrl | String |
memberCount | Int |
GroupRequest
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
groupId | String |
kind | String |
username | String |
nickname | String |
avatarUrl | String |
inviter | GroupRequestUser? |
message | String? |
reason | String? |
status | String |
cancelCause | String? |
requestedAt | Long? |
expiresAt | Long? |
handledAt | Long? |
handledBy | String? |
group | GroupBrief? |
GroupInviteSettings
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
inviteMode | InviteMode? |
effectiveInviteMode | InviteMode? |
Files
FileKind
Values: IMAGE, VOICE, VIDEO, FILE.
UploadPurpose
Values: ATTACHMENT, USER_AVATAR, GROUP_AVATAR, CHATROOM_AVATAR, GROUP_FILE.
DRFile
Create one with fromFile, fromBytes or Android's fromUri. withKeepMetadata returns a new source that keeps metadata; normally keep the default stripping. For the factory signatures, see the API reference.
| Field | Type |
|---|---|
name | String? |
mimeType | String? |
keepMetadata | Boolean |
FileInfo
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
fileId | String |
purpose | String |
kind | String |
status | String |
url | String |
thumbnailUrl | String? |
name | String? |
contentType | String |
size | Long |
width | Int? |
height | Int? |
owner | String? |
groupId | String? |
via | String |
createdAt | Long? |
expiresAt | Long? |
GroupFile
| Field | Type |
|---|---|
ownerNickname | String? |
ownerAvatarUrl | String? |
GroupFilesPage
| Field | Type |
|---|---|
items | List<GroupFile> |
nextCursor | String? |
fileCount | Int |
usedBytes | Long |
DownloadUrl
| Field | Type |
|---|---|
downloadUrl | String |
expiresAt | Long |
ResolvedUrl
| Field | Type |
|---|---|
url | String |
downloadUrl | String? |
expiresAt | Long? |
error | DRException? |
Progress
| Field | Type |
|---|---|
loaded | Long |
total | Long |
DownloadSource
Branches (written as DownloadSource.Name):
class File(val url: String)
class Thumbnail(val url: String)
class Message(val message: MessageView)Conflict
Values: RENAME, OVERWRITE, FAIL.
PreparedFile
| Field | Type |
|---|---|
file | java.io.File |
kind | FileKind |
name | String |
format | String |
contentType | String |
size | Long |
width | Int? |
height | Int? |
duration | Duration? |
thumbnail | java.io.File? |
downgraded | String? |
metadataKept | Boolean |
durationMillis | Long? |
Chatrooms
ChatroomState
ENTERING:"entering"IN:"in"REENTERING:"reentering"REMOVED:"removed"LEFT:"left"
ChatroomSelf
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
role | String |
inRoom | Boolean |
muted | Boolean |
mutedUntil | Long? |
allowlisted | Boolean |
ChatroomInfo
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
roomId | String |
name | String |
description | String |
avatarUrl | String |
announcement | String |
announcementUpdatedAt | Long? |
announcementUpdatedBy | String? |
owner | String? |
admins | List<String> |
maxMembers | Int |
muteAll | Boolean |
listed | Boolean |
status | String |
disabledBy | String? |
memberCount | Int |
infoVersion | Long |
attributesVersion | Long |
createdAt | Long? |
self | ChatroomSelf? |
ChatroomListItem
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
roomId | String |
name | String |
description | String |
avatarUrl | String |
owner | String? |
maxMembers | Int |
memberCount | Int |
ChatroomOnlineCount
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
roomId | String |
memberCount | Int |
ChatroomAttribute
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
value | String? |
owner | String? |
autoDelete | Boolean |
updatedAt | Long? |
AttributeResult
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
changed | Boolean |
attributesVersion | Long |
failed | Map<String, JsonObject> |
ChatroomMessageLocal
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
status | String |
error | DRException? |
trusted | Boolean |
ChatroomMessageView
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
roomId | String |
messageId | String? |
clientMsgId | String? |
sender | String? |
senderType | String |
senderNickname | String? |
senderAvatarUrl | String? |
senderRole | String? |
type | String |
body | JsonObject? |
ext | JsonObject? |
priority | String |
via | String |
createdAt | Long? |
local | ChatroomMessageLocal |
ChatroomMember
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
role | String |
joinedAt | Long? |
ChatroomMemberResult
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
result | String? |
code | String? |
message | String? |
details | JsonObject? |
ok | Boolean |
ChatroomMuteEntry
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
mutedUntil | Long? |
reason | String |
createdBy | String? |
createdByRole | String |
createdAt | Long? |
ChatroomBanEntry
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
expiresAt | Long? |
reason | String |
createdBy | String? |
createdByRole | String |
createdAt | Long? |
ChatroomAllowlistEntry
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
createdBy | String? |
createdAt | Long? |
ChatroomPatch
class ChatroomPatch (
val name: String? = null,
val description: String? = null,
val avatarUrl: String? = null,
val announcement: String? = null,
val maxMembers: Int? = null,
val resetMaxMembers: Boolean = false,
val listed: Boolean? = null,
)| Field | Type |
|---|---|
name | String? |
description | String? |
avatarUrl | String? |
announcement | String? |
maxMembers | Int? |
resetMaxMembers | Boolean |
listed | Boolean? |
ChatroomPriority
Values: HIGH, NORMAL, LOW.
ChatroomRemoved
| Field | Type |
|---|---|
reason | String |
operator | String? |
expiresAt | Long? |
ChatroomSnapshot
| Field | Type |
|---|---|
info | ChatroomInfo |
attributes | Map<String, ChatroomAttribute> |
attributesVersion | Long |
messages | List<ChatroomMessageView> |
state | String |
removed | ChatroomRemoved? |
ChatroomEvent
MemberJoined / MemberLeft also provide username: String? alongside the original data.
Branches (written as ChatroomEvent.Name):
data class MessageReceived(val message: ChatroomMessageView)
data class MessageRecalled(val messageId: String, val recalledBy: String?, val recalledAt: Long?)
data class MemberJoined(val data: JsonObject)
data class MemberLeft(val data: JsonObject)
data class Like(val username: String, val count: Int)
data class Dropped(val count: Int)
data class Removed(val removed: ChatroomRemoved)Calls
CallMedia
Values: AUDIO, VIDEO.
RejectReason
Values: DECLINED, BUSY.
CallStatus
RINGING:"ringing"ACTIVE:"active"ENDED:"ended"
CallMemberState
RINGING:"ringing"JOINED:"joined"LEFT:"left"DECLINED:"declined"BUSY:"busy"MISSED:"missed"CANCELED:"canceled"
CallTarget
Branches (written as CallTarget.Name):
class User(val username: String)
class Group(val groupId: String, val usernames: List<String>? = null)CallMember
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String? |
role | String |
state | String |
mediaUid | Int |
invitedBy | String? |
ringExpiresAt | Long? |
joinedAt | Long? |
leftAt | Long? |
leaveReason | String? |
CallSelf
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
state | String? |
joinedOnThisDevice | Boolean |
Call
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
callId | String |
type | String |
groupId | String? |
media | String |
status | String |
initiator | String? |
maxParticipants | Int |
joinedCount | Int |
members | List<CallMember> |
createdAt | Long? |
answeredAt | Long? |
endedAt | Long? |
endReason | String? |
endedBy | String? |
duration | Duration? |
durationMillis | Long? |
version | Long |
ext | Map<String, String>? |
self | CallSelf? |
CallSummary
| Field | Type |
|---|---|
peer | String? |
CallChange
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
kind | String |
usernames | List<String> |
actor | String? |
reason | String? |
CallInviteResult
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
status | String? |
code | String? |
message | String? |
details | JsonObject? |
ok | Boolean |
CallInviter
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
nickname | String |
avatarUrl | String |
CallGroup
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
groupId | String |
name | String |
avatarUrl | String |
GroupCallBanner
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
groupId | String |
callId | String |
media | String |
status | String |
joinedCount | Int |
initiator | String? |
version | Long |
CallLocalMedia
| Field | Type |
|---|---|
microphone | Boolean |
camera | Boolean |
CallRemoteMedia
| Field | Type |
|---|---|
username | String? |
mediaUid | Int |
audio | Boolean |
video | Boolean |
CallSnapshot
| Field | Type |
|---|---|
call | Call |
self | CallSelf? |
inviter | CallInviter? |
group | CallGroup? |
media | String |
local | CallLocalMedia |
remote | List<CallRemoteMedia> |
ringing | Boolean |
resumable | Boolean |
CallTrack
| Field | Type |
|---|---|
username | String? |
mediaUid | Int |
local | Boolean |
CallTracks
| Field | Type |
|---|---|
local | CallTrack? |
remote | List<CallTrack> |
CallDataMessage
| Field | Type |
|---|---|
username | String? |
mediaUid | Int |
data | ByteArray |
Alerts and push content
PushPreview
Values: FULL, SENDER_ONLY, NONE.
MuteMode
Values: NONE, MENTION_ONLY.
MuteTarget
Create one with MuteTarget.single(username) or MuteTarget.group(groupId); the constructor isn't public.
| Field | Type |
|---|---|
conversationType | String |
target | String |
MuteInfo
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
mode | String |
muteMode | MuteMode? |
until | Long? |
QuietHours
class QuietHours(val start: String, val end: String, val timezone: String)| Field | Type |
|---|---|
start | String |
end | String |
timezone | String |
PushSettings
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
dndEnabled | Boolean |
dndUntil | Long? |
quietHours | QuietHours? |
preview | PushPreview? |
effectivePreview | PushPreview |
settingsVersion | Long |
DndChange
Branches (written as DndChange.Name):
class On(val duration: Duration? = null)
data object OffQuietHoursChange
Branches (written as QuietHoursChange.Name):
class Set(val value: QuietHours)
data object OffPreviewChange
Branches (written as PreviewChange.Name):
class Set(val value: PushPreview)
data object UseDefaultPushChannel
Values: FCM, HUAWEI, HONOR, XIAOMI, OPPO, VIVO, MEIZU.
PushPayload
PushPayload is in com.deeprespond.im.push. Its common fields are raw (JsonObject), version (Int) and kind (String); unknown kinds are kept as Unknown and should be handled like ordinary notifications. PushPayload.parse(data, channel?) parses channel data and returns null when there's no SDK payload; fromIm(JsonObject) parses an im object directly.
| Branch | Extra fields |
|---|---|
| Message | conversationType: String, conversationId: String, seq: Long?, messageId: String?, sender: String?, ext: JsonObject?, extDropped: Boolean |
| Recall | conversationType: String, conversationId: String, messageId: String? |
| Notice | notice: String?, user: String?, groupId: String? |
| Call | event: String, callId: String, data: JsonObject?, title: String?, body: String?, callerName: String?, ringExpiresAt: Long? |
| Dismiss | callId: String |
| Test, Unknown | Common fields only |
Common Call.event values are incoming, missed and cancelled. Depending on the notification preview policy, details may be empty; when the notification is tapped, get the latest data through the module.
Branches (written as PushPayload.Name):
data class Message(override val raw: JsonObject)
data class Recall(override val raw: JsonObject)
data class Notice(override val raw: JsonObject)
data class Call(override val raw: JsonObject)
data class Dismiss(override val raw: JsonObject)
data class Test(override val raw: JsonObject)
data class Unknown(override val raw: JsonObject)Presence and reports
PresenceState
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
username | String |
online | Boolean |
platforms | List<String> |
lastSeenAt | Long? |
version | Long |
PresenceFailure
Values: DENIED, LIMIT_EXCEEDED, PRESENCE_DISABLED.
ReportReason
Values: AD, FRAUD, PORN, POLITICS, TERRORISM, ABUSE, ILLEGAL, INFRINGEMENT, MINOR, OTHER.
ReportTarget
Branches (written as ReportTarget.Name):
class Message(val messageId: String)
class User(val username: String, val evidenceMessageIds: List<String>? = null)
class Group(val groupId: String, val evidenceMessageIds: List<String>? = null)
class Chatroom(val roomId: String)
class ChatroomMessage(val roomId: String, val messageId: String)Report
A read-only view of server data that extends DRObject. You get it from module methods and can't construct it yourself.
| Field | Type |
|---|---|
reportId | String |
targetType | String |
username | String? |
messageId | String? |
groupId | String? |
roomId | String? |
reason | String |
status | String |
createdAt | Long? |
ReportSubmitResult
| Field | Type |
|---|---|
report | Report |
duplicate | Boolean |
Client options
LogLevel
Values: DEBUG, INFO, WARN, ERROR.
LogEntry
| Field | Type |
|---|---|
level | LogLevel |
time | Long |
module | String |
message | String |
code | String? |
reason | String? |
requestId | String? |
connectionId | String? |
LogOptions
class LogOptions(
val level: LogLevel = LogLevel.WARN,
val sink: ((LogEntry) -> Unit)? = null,
val file: Boolean = false,
)| Field | Type |
|---|---|
level | LogLevel |
sink | ((LogEntry) -> Unit)? |
file | Boolean |
OutboxOptions
class OutboxOptions(
val maxAge: Duration = 48.hours,
val persistAttachmentMaxBytes: Long = 200L * 1024 * 1024,
)| Field | Type |
|---|---|
maxAge | Duration |
persistAttachmentMaxBytes | Long |
maxAgeMillis | Long |
MediaOptions
class MediaOptions(
val compressImages: Boolean = true,
val imageMaxSide: Int = 2048,
val jpegQuality: Int = 85,
val imageCacheBytes: Long = 300L * 1024 * 1024,
val preprocess: (suspend (DRFile, FileKind) -> DRFile)? = null,
)| Field | Type |
|---|---|
compressImages | Boolean |
imageMaxSide | Int |
jpegQuality | Int |
imageCacheBytes | Long |
preprocess | (suspend (DRFile, FileKind) -> DRFile)? |
SqliteSource
Values: SYSTEM, BUNDLED.
DatabaseOptions
class DatabaseOptions(
val encrypt: Boolean = false,
val driver: SqliteSource = SqliteSource.SYSTEM,
)| Field | Type |
|---|---|
encrypt | Boolean |
driver | SqliteSource |
TicketProvider
typealias TicketProvider = suspend (TicketContext) -> StringThis function fetches a ticket from your backend. Android calls it on an IO thread with a 30-second timeout. Java uses JavaTicketProvider.
TicketContext
class TicketContext(val reason: Reason, val username: String?)| Field | Type |
|---|---|
reason | Reason |
username | String? |
TicketContext.Reason: INVALID_CREDENTIALS, SESSION_EXPIRED.
DRClientOptions
class DRClientOptions(
val appKey: String,
val apiUrl: String,
val wsUrl: String? = null,
val deviceName: String? = null,
val appVersion: String? = null,
val ticketProvider: TicketProvider? = null,
val autoMarkRead: Boolean = false,
val conversationWindow: Int = 1000,
val userCacheTtl: Duration = 10.minutes,
val outbox: OutboxOptions = OutboxOptions(),
val media: MediaOptions = MediaOptions(),
val database: DatabaseOptions = DatabaseOptions(),
val badgeProvider: (() -> Int)? = null,
val push: DRPushOptions? = null,
val call: DRCallOptions? = null,
val log: LogOptions = LogOptions(),
)| Field | Type |
|---|---|
appKey | String |
apiUrl | String |
wsUrl | String? |
deviceName | String? |
appVersion | String? |
ticketProvider | TicketProvider? |
autoMarkRead | Boolean |
conversationWindow | Int |
userCacheTtl | Duration |
outbox | OutboxOptions |
media | MediaOptions |
database | DatabaseOptions |
badgeProvider | (() -> Int)? |
push | DRPushOptions? |
call | DRCallOptions? |
log | LogOptions |
userCacheTtlMillis | Long |
Native push
In the com.deeprespond.im.push package.
BadgeMode
Values: AUTO, MANUAL.
AndroidChannel
class AndroidChannel (
val id: String,
val name: String,
val kind: Kind,
val description: String? = null,
val sound: Uri? = null,
)| Field | Type |
|---|---|
id | String |
name | String |
kind | Kind |
description | String? |
sound | Uri? |
AndroidChannel.Kind: MESSAGE, CALL, SILENT.
DRPushOptions
class DRPushOptions (
val credentials: Map<PushChannel, String>,
val vendors: List<VendorPush> = emptyList(),
val androidChannels: List<AndroidChannel> = AndroidChannel.defaults(),
val language: String? = null,
val badge: BadgeMode = BadgeMode.AUTO,
val smallIcon: Int? = null,
val accentColor: Int? = null,
)| Field | Type |
|---|---|
credentials | Map<PushChannel, String> |
vendors | List<VendorPush> |
androidChannels | List<AndroidChannel> |
language | String? |
badge | BadgeMode |
smallIcon | Int? |
accentColor | Int? |
PushPermission
Values: GRANTED, DENIED, NOT_DETERMINED.
PushOpened
| Field | Type |
|---|---|
payload | PushPayload |
launched | Boolean |
forCurrentUser | Boolean |
trusted | Boolean |
PushRegistration
| Field | Type |
|---|---|
channels | List<ChannelResult> |
error | DRException? |
ChannelResult
| Field | Type |
|---|---|
channel | PushChannel |
state | TokenState |
fallback | Boolean |
ChannelResult.TokenState: READY, PENDING, UNAVAILABLE.
PushDevice
| Field | Type |
|---|---|
platform | String |
tokens | List<PushToken> |
language | String? |
raw | JsonObject |
PushToken
| Field | Type |
|---|---|
raw | JsonObject |
credential | String? |
channel | String? |
token | String? |
Native calls
In the com.deeprespond.im.call package.
DRCallOptions
class DRCallOptions (
val incomingCallActivity: Class<out Activity>? = null,
val useTelecom: Boolean = true,
val autoBusy: Boolean = true,
val ringtone: Uri? = null,
)| Field | Type |
|---|---|
incomingCallActivity | Class<out Activity>? |
useTelecom | Boolean |
autoBusy | Boolean |
ringtone | Uri? |
CallAction
| Field | Type |
|---|---|
callId | String |
action | Kind |
source | Source |
CallAction.Kind: ANSWER, REJECT, HANGUP, MUTE, UNMUTE, HOLD, UNHOLD, SHOW, OPEN.
CallAction.Source: NOTIFICATION, TELECOM.
CallIntent
| Field | Type |
|---|---|
callId | String |
action | Action |
CallIntent.Action: ANSWER, SHOW.
AudioEndpoints
| Field | Type |
|---|---|
available | List<AudioEndpoint> |
current | AudioEndpoint? |
AudioEndpoint
| Field | Type |
|---|---|
id | String |
type | Type |
name | String |
AudioEndpoint.Type: EARPIECE, SPEAKER, BLUETOOTH, WIRED_HEADSET, STREAMING.
Recording
VoiceRecorder, Recording and VoiceRecording are in com.deeprespond.im. After recording, call recording.toContent() to get the message content.
VoiceRecording
| Field | Type |
|---|---|
file | File |
duration | Duration |
format | String |
durationMillis | Long |
VoiceRecordingEnd
| Field | Type |
|---|---|
recording | VoiceRecording? |
reason | Reason |
VoiceRecordingEnd.Reason: MAX_DURATION, INTERRUPTED.
Errors
DRException
| Field | Type |
|---|---|
code | String |
details | JsonObject? |
status | Int? |
requestId | String? |
retryAfter | Duration? |
source | Source |
reason | String? |
retryAfterMillis | Long? |
DRException.Source: HTTP, WS, LOCAL.
LocalErrorCode
NETWORK_ERROR:"network_error"TIMEOUT:"timeout"ABORTED:"aborted"NOT_SIGNED_IN:"not_signed_in"NOT_CONNECTED:"not_connected"LOCAL_VALIDATION:"local_validation"STORAGE_ERROR:"storage_error"UNSUPPORTED:"unsupported"PERMISSION_REQUIRED:"permission_required"DEVICE_ERROR:"device_error"INVALID_STATE:"invalid_state"SEND_ABANDONED:"send_abandoned"INTERNAL:"internal"PERMISSION_DENIED:"permission_denied"RATE_LIMITED:"rate_limited"
Events
DREvent
Branches (written as DREvent.Name):
data class AuthStateChanged(val state: AuthState)
data class ConnectionStateChanged(val state: DRConnectionState)
data class SyncCompleted(val modules: List<SyncModule>, val trigger: SyncTrigger)
data class SyncFailed(val module: SyncModule, val error: DRException)
data class StorageReset(val reason: String, val droppedMessages: Int? = null)
data class StorageFull(val freedUsers: Int)
data class StorageModeChanged(val mode: StorageMode, val reason: StorageModeReason?)
data class ConfigChanged(val config: ClientConfig?)
data class MeChanged(val me: SelfProfile?)
data class MeMuteChanged(val scope: String, val muted: Boolean, val expiresAt: Long?)
data class UsersChanged(val usernames: List<String>)
data class DevicesChanged(val devices: List<OnlineDevice>)
data class DevicesNewLogin(val sessionId: String, val deviceName: String, val platform: String, val loginMethod: String, val createdAt: Long?)
data class SdkUpgradeRequired(val minVersion: String)
data class AppStateChanged(val background: Boolean)
data class ClientStateReported(val background: Boolean, val badge: Int?, val reported: Boolean)
data class TimezoneChanged(val timezone: String, val offsetMinutes: Int)
data class ConversationsChanged(val upserted: List<String>, val removed: List<String>)
data class ConversationsUnreadChanged(val total: Int, val source: String)
data class MessagesChanged(val conversationKey: String, val upserted: List<Long>, val removed: List<Long>, val pending: List<String>, val renamedFrom: String?)
data class MessageReceived(val message: MessageView, val notify: NotifyDecision, val alert: Boolean)
data class MessageSendFailed(val clientMsgId: String, val conversationKey: String, val error: DRException)
data class MessageOnline(val message: OnlineMessage)
data class TypingChanged(val conversationKey: String, val usernames: List<String>)
data class ReceiptsChanged(val conversationId: String, val seqs: List<Long>)
data class FriendsChanged(val upserted: List<String>, val removed: List<String>)
data class BlacklistChanged(val upserted: List<String>, val removed: List<String>)
data class FriendRequestsChanged(val lists: List<String>, val unreadCount: Int)
data class GroupsChanged(val upserted: List<String>, val removed: List<String>)
data class GroupMembersChanged(val groupId: String, val usernames: List<String>?)
data class GroupRequestsChanged(val list: String, val groupId: String?)
data class PushChanged(val settings: Boolean, val mutes: List<MuteTarget>)
data class PresenceChanged(val items: List<PresenceState>, val reset: Boolean, val cleared: List<String>)
data class PresenceSubscribeFailed(val usernames: List<String>, val reason: PresenceFailure?)
data class CallIncoming(val call: CallHandle)
data class CallChanged(val call: CallHandle, val change: CallChange?)
data class GroupCallChanged(val groupId: String, val banner: GroupCallBanner?)StorageMode
Values: SQLITE, MEMORY.
StorageModeReason
Values: UNAVAILABLE, MIGRATION_FAILED.
Common helper methods
| Type | Method or entry point | Description |
|---|---|---|
| LiveListSnapshot | copy(...), empty<T>() | Copy a snapshot, or create an empty one |
| OutboxOptions | ofMillis(maxAgeMs, persistAttachmentMaxBytes) | Java constructor taking milliseconds |
| MediaOptions | builder() | Java builder, including the preprocess bridge |
| DRClientOptions | builder(appKey, apiUrl) | Java initialization, with userCacheTtlMillis |
| DRPushOptions | builder(credentials) | Java push configuration |
| DRCallOptions | builder() | Java incoming-call configuration |
| AndroidChannel | defaults() | The three default Android notification channels |
| DndChange.On | ofMillis(durationMs?) | Do-not-disturb duration for Java; null means no end time |
| Call | member(username) | Finds a call member; may be null |
| VoiceRecording | toContent() | Converts to OutgoingContent.Voice |
| DRException | reason, retryAfterMillis | Error reason, and the retry wait in milliseconds for Java |
For Java callbacks, listeners and resource handles, see Java; for DRImage and video views, see the API reference.
Standalone RTC channels
| Type | Main public fields |
|---|---|
| RTCChannel | channelId, name, media, status, accessMode, defaultRole, maxParticipants, seatCount, joinedCount, version, membersVersion, expiresAt |
| ChannelSession | channelId, sessionId, clientSessionId, username, status, role, version, joinDeadline, maxExpiresAt, leaveReason, mediaConnected |
| ChannelParticipant | sessionId, username, role, status, mediaIdentity, mediaConnected, version |
| ChannelSnapshot | channel, session, members, mediaState, microphoneEnabled, cameraEnabled, error |
| ChannelTrack | sessionId, username, kind, local; the underlying media track is held internally |
| ChannelJoinOptions | ticket, clientSessionId, microphoneEnabled=false, cameraEnabled=false |
IDs are Strings. On Android the Boolean getter mediaConnected loses the HTTP API's third state (null); when HTTP reports it as unknown, combine the raw field with the observed media state, and don't show someone as live from the getter alone. Tickets and credentials are never saved in snapshots. For usage, see Channels.
