Package-level declarations

Types

Link copied to clipboard
data class AssetPreviewEntity(val mimeType: String, val size: Long, val width: Int, val height: Int, val id: String, val domain: String?, val token: String?, val otrKey: ByteArray, val sha256: ByteArray, val encryptionAlgorithm: String?)

Independently addressable preview metadata. Binary columns contain only cryptographic material.

Link copied to clipboard
Link copied to clipboard
internal class AsyncQueryPagingSource<RowType : Any, ItemType : Any>(countQuery: Query<Long>, context: CoroutineContext, queryProvider: (limit: Long, offset: Long) -> Query<RowType>, initialOffset: Long = 0, postProcessor: suspend (List<RowType>) -> List<ItemType>, transacter: SuspendingTransacter? = null) : PagingSource<Int, ItemType> , Query.Listener

Loads a page of query rows and optionally enriches them in one database transaction. The postprocessor must preserve row count and order so offsets remain valid.

Link copied to clipboard
@Serializer(forClass = Boolean::class)
class BooleanIntSerializer : KSerializer<Boolean>
Link copied to clipboard
@Serializable
class ButtonEntity(val text: String, val id: String, val isSelected: Boolean)
Link copied to clipboard
Link copied to clipboard
internal class CompositeMessageDAOImpl(buttonContentQueries: ButtonContentQueries, writeDispatcher: WriteDispatcher) : CompositeMessageDAO
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class KaliumPager<EntityType : Any>(pager: Pager<Int, EntityType>, val pagingSource: PagingSource<Int, EntityType>, readDispatcher: ReadDispatcher, invalidateOn: Flow<*>? = null, invalidatePagingSource: () -> Unit? = null)

Exposes a pagingDataFlow that can be used in Android UI components to display paginated data.

Link copied to clipboard
object LocalId
Link copied to clipboard
data class MessageAssetStatusEntity(val id: String, val conversationId: QualifiedIDEntity, val transferStatus: AssetTransferStatusEntity)
Link copied to clipboard
interface MessageDAO
Link copied to clipboard
internal class MessageDAOImpl(queries: MessagesQueries, attachmentsQueries: MessageAttachmentsQueries, assetViewQueries: MessageAssetViewQueries, notificationQueries: NotificationQueries, conversationsQueries: ConversationsQueries, unreadEventsQueries: UnreadEventsQueries, messagePreviewQueries: MessagePreviewQueries, cellFilesQueries: CellFilesQueries, selfUserId: UserIDEntity, reactionsQueries: ReactionsQueries, userQueries: UsersQueries, readDispatcher: ReadDispatcher, writeDispatcher: WriteDispatcher, assetStatusQueries: MessageAssetTransferStatusQueries, buttonContentQueries: ButtonContentQueries, pollContentQueries: PollContentQueries) : MessageDAO, MessageInsertExtension
Link copied to clipboard
sealed interface MessageEntity
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal class MessageExtensionsImpl(messagesQueries: MessagesQueries, messageAttachmentsQueries: MessageAttachmentsQueries, messageAssetViewQueries: MessageAssetViewQueries, messageMapper: MessageMapper, readDispatcher: ReadDispatcher) : MessageExtensions
Link copied to clipboard
internal interface MessageInsertExtension

Explaining that this is mainly used to share a bit of logic between MessageDAO and MigrationDAO

Link copied to clipboard
internal class MessageInsertExtensionImpl(messagesQueries: MessagesQueries, cellFilesQueries: CellFilesQueries, attachmentQueries: MessageAttachmentsQueries, unreadEventsQueries: UnreadEventsQueries, conversationsQueries: ConversationsQueries, buttonContentQueries: ButtonContentQueries, pollContentQueries: PollContentQueries, selfUserIDEntity: UserIDEntity) : MessageInsertExtension
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal class MessageMetadataDAOImpl(metaDataQueries: MessageMetadataQueries, readDispatcher: ReadDispatcher) : MessageMetadataDAO
Link copied to clipboard
data class MessagePreviewEntity(val id: String, val conversationId: QualifiedIDEntity, val content: MessagePreviewEntityContent, val visibility: MessageEntity.Visibility, val isSelfMessage: Boolean, val senderUserId: QualifiedIDEntity)

Simplified model of MessageEntity used everywhere where there is no need to have all the fields for example in conversation list or notifications

Link copied to clipboard
Link copied to clipboard
class MessageTimelineCursorEntity(val messageId: String, val date: Instant, val conversationId: ConversationIDEntity, val scope: Any, val generation: Any, val includeDeleted: Boolean)

A database tuple. Only the issuing account, conversation and display policy may use it.

Link copied to clipboard
class MessageTimelineDAO(queries: MessageTimelineQueries, driver: SqlDriver, readDispatcher: ReadDispatcher)
Link copied to clipboard
Link copied to clipboard
data class MessageTimelinePageEntity(val rows: List<TimelineRows>, val cursors: Map<String, MessageTimelineCursorEntity>, val olderCursor: MessageTimelineCursorEntity?, val newerCursor: MessageTimelineCursorEntity?, val anchorMessageId: String?, val mentions: Map<String, List<MessageMention>> = emptyMap(), val previews: Map<String, List<TimelinePreviews>> = emptyMap(), val buttons: Map<String, List<ButtonContent>> = emptyMap(), val polls: Map<String, MessageEntityContent.Poll> = emptyMap(), val reactions: Map<String, List<TimelineReactions>> = emptyMap(), val readCounts: Map<String, Long> = emptyMap(), val failures: Map<String, List<MessageRecipientFailure>> = emptyMap(), val attachments: Map<String, List<TimelineAttachments>> = emptyMap(), val systemContents: Map<String, MessageEntityContent.System> = emptyMap(), val users: Map<UserIDEntity, TimelineUsers> = emptyMap())

Page-scoped rows. None of these queries hydrate MessageDetailsView or UserDetails.

Link copied to clipboard
Link copied to clipboard
class MessageTimelineSession(queries: MessageTimelineQueries, driver: SqlDriver, readDispatcher: ReadDispatcher, cursorScope: Any, conversationId: ConversationIDEntity, includeDeleted: Boolean, onInvalidated: () -> Unit) : AutoCloseable, Query.Listener

One invalidatable read generation. Register before loading and close when the consumer leaves.

Link copied to clipboard
data class NotificationMessageEntity(val id: String, val contentType: MessageEntity.ContentType, val isSelfDelete: Boolean, val senderUserId: QualifiedIDEntity, val senderImage: UserAssetIdEntity?, val date: Instant, val senderName: String?, val text: String?, val assetMimeType: String?, val isQuotingSelf: Boolean, val conversationId: QualifiedIDEntity, val conversationName: String?, val mutedStatus: ConversationEntity.MutedStatus, val conversationType: ConversationEntity.Type, val degradedConversationNotified: Boolean, val legalHoldStatus: ConversationEntity.LegalHoldStatus, val legalHoldStatusChangeNotified: Boolean)
Link copied to clipboard
data class NotificationMessageKey(val messageId: String, val conversationId: QualifiedIDEntity)

Message identities are scoped to a conversation and this DAO's account.

Link copied to clipboard

Message identities only. The app acknowledges work after the delivery signal succeeds.

Link copied to clipboard
data class PendingDeliveryConfirmationEntity(val id: Long, val conversationId: ConversationIDEntity, val messageId: String)
Link copied to clipboard
internal class PendingMessagesPagingSource<RowType : Any>(totalCountQuery: Query<Long>, pendingCountQuery: Query<Long>, context: CoroutineContext, pendingQueryProvider: (limit: Long, offset: Long) -> Query<RowType>, nonPendingQueryProvider: (limit: Long, offset: Long) -> Query<RowType>, initialOffset: Long = 0, postProcessor: suspend (List<RowType>) -> List<RowType>? = null) : PagingSource<Int, RowType> , Query.Listener

Paging source for conversation messages where pending messages must be exposed as a dedicated leading segment.

Link copied to clipboard
internal object PollContentJson

JSON stored in poll columns and aggregated by MessageDetailsView. Kotlin encodes every user-provided string, so SQL never has to escape option text.

Link copied to clipboard
interface PollMessageDAO
Link copied to clipboard
internal class PollMessageDAOImpl(pollContentQueries: PollContentQueries, readDispatcher: ReadDispatcher, writeDispatcher: WriteDispatcher) : PollMessageDAO
Link copied to clipboard
@Serializable
data class PollOptionEntity(val id: String, val text: String)
Link copied to clipboard
data class PollVoteEntity(val voterId: QualifiedIDEntity, val selectedOptionIds: List<String>, val date: Instant)
Link copied to clipboard

The type of the failure that happened when trying to deliver a message to a recipient.

Link copied to clipboard

Functions

Link copied to clipboard
internal fun assetPreviewEntity(mimeType: String?, size: Long?, width: Int?, height: Int?, id: String?, domain: String?, token: String?, otrKey: ByteArray?, sha256: ByteArray?, encryptionAlgorithm: String?): AssetPreviewEntity?
Link copied to clipboard