MessageDAOImpl

internal class MessageDAOImpl(queries: MessagesQueries, assetViewQueries: MessageAssetViewQueries, notificationQueries: NotificationQueries, conversationsQueries: ConversationsQueries, unreadEventsQueries: UnreadEventsQueries, messagePreviewQueries: MessagePreviewQueries, selfUserId: UserIDEntity, reactionsQueries: ReactionsQueries, coroutineContext: <Error class: unknown class>, assetStatusQueries: MessageAssetTransferStatusQueries, buttonContentQueries: ButtonContentQueries) : MessageDAO, MessageInsertExtension

Constructors

Link copied to clipboard
internal constructor(queries: MessagesQueries, assetViewQueries: MessageAssetViewQueries, notificationQueries: NotificationQueries, conversationsQueries: ConversationsQueries, unreadEventsQueries: UnreadEventsQueries, messagePreviewQueries: MessagePreviewQueries, selfUserId: UserIDEntity, reactionsQueries: ReactionsQueries, coroutineContext: <Error class: unknown class>, assetStatusQueries: MessageAssetTransferStatusQueries, buttonContentQueries: ButtonContentQueries)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
open suspend override fun deleteAllMessages(): <Error class: unknown class>
Link copied to clipboard
open suspend override fun deleteMessage(id: String, conversationsId: QualifiedIDEntity): <Error class: unknown class>
Link copied to clipboard
open suspend override fun getAllAlreadyEndedEphemeralMessages(): List<MessageEntity>
Link copied to clipboard
open suspend override fun getAllPendingEphemeralMessages(): List<MessageEntity>
Link copied to clipboard
open suspend override fun getAllPendingMessagesFromUser(userId: UserIDEntity): List<MessageEntity>
Link copied to clipboard
open suspend override fun getConversationUnreadEventsCount(conversationId: QualifiedIDEntity): Long
Link copied to clipboard
open suspend override fun getImageMessageAssets(conversationId: QualifiedIDEntity, mimeTypes: Set<String>, limit: Int, offset: Int): List<AssetMessageEntity>
Link copied to clipboard
open suspend override fun getLastMessagesByConversations(conversationIds: List<QualifiedIDEntity>): Map<QualifiedIDEntity, MessageEntity>
Link copied to clipboard
open suspend override fun getMessageAssetTransferStatus(messageId: String, conversationId: QualifiedIDEntity): AssetTransferStatusEntity
Link copied to clipboard
open suspend override fun getMessageById(id: String, conversationId: QualifiedIDEntity): MessageEntity?
open suspend override fun getMessageIdsThatExpectReadConfirmationWithinDates(conversationId: QualifiedIDEntity, afterDate: <Error class: unknown class>, untilDate: <Error class: unknown class>, visibility: List<MessageEntity.Visibility>): List<String>
Link copied to clipboard
open suspend override fun getMessagesByConversationAndVisibility(conversationId: QualifiedIDEntity, limit: Int, offset: Int, visibility: List<MessageEntity.Visibility>): <Error class: unknown class><List<MessageEntity>>
Link copied to clipboard
open suspend override fun getNotificationMessage(maxNumberOfMessagesPerConversation: Int): List<NotificationMessageEntity>
Link copied to clipboard
open suspend override fun getSearchedConversationMessagePosition(conversationId: QualifiedIDEntity, messageId: String): Int
Link copied to clipboard
open suspend override fun insertFailedRecipientDelivery(id: String, conversationsId: QualifiedIDEntity, recipientsFailed: List<QualifiedIDEntity>, recipientFailureTypeEntity: RecipientFailureTypeEntity): <Error class: unknown class>
Link copied to clipboard
open override fun insertMessageOrIgnore(message: MessageEntity)
Link copied to clipboard
open suspend override fun insertOrIgnoreMessage(message: MessageEntity, updateConversationModifiedDate: Boolean): <Error class: unknown class>

Inserts the message, or ignores if there's already a message with the same MessageEntity.id and MessageEntity.conversationId. There is only one exception where a second message with the same id will not be ignored, and it is when the first message is an asset preview message. In this case, the second message containing the valid encryption keys will be updating and completing the encryption keys and the visibility of the first one.

Link copied to clipboard
open suspend override fun insertOrIgnoreMessages(messages: List<MessageEntity>): <Error class: unknown class>

Inserts the messages, or ignores messages if there already exists a message with the same MessageEntity.id and MessageEntity.conversationId. There is only one exception where a second message with the same id will not be ignored, and it is when the first message is an asset preview message. In this case, the second message containing the valid encryption keys will be updating and completing the encryption keys and the visibility of the first one.

Link copied to clipboard
open override fun isValidAssetMessageUpdate(message: MessageEntity): Boolean

Returns true if the message is an asset message that is already in the DB and any of its decryption keys are null/empty. This means that this asset message that is in the DB was only a preview message with valid metadata but no valid keys (Web clients send 2 separated messages). Therefore, it still needs to be updated with the valid keys in order to be displayed.

Link copied to clipboard
open suspend override fun markMessageAsDeleted(id: String, conversationsId: QualifiedIDEntity): <Error class: unknown class>
Link copied to clipboard
open suspend override fun markMessagesAsDecryptionResolved(conversationId: QualifiedIDEntity, userId: QualifiedIDEntity, clientId: String): <Error class: unknown class>
Link copied to clipboard
open suspend override fun moveMessages(from: ConversationIDEntity, to: ConversationIDEntity): <Error class: unknown class>
Link copied to clipboard
open suspend override fun needsToBeNotified(id: String, conversationId: QualifiedIDEntity): <Error class: unknown class>
Link copied to clipboard
open suspend override fun observeAssetStatuses(conversationId: QualifiedIDEntity): <Error class: unknown class><List<MessageAssetStatusEntity>>
Link copied to clipboard
open suspend override fun observeConversationsUnreadEvents(): <Error class: unknown class><List<ConversationUnreadEventEntity>>
Link copied to clipboard
open suspend override fun observeLastMessages(): <Error class: unknown class><List<MessagePreviewEntity>>
open suspend override fun observeMessagesByConversationAndVisibilityAfterDate(conversationId: QualifiedIDEntity, date: String, visibility: List<MessageEntity.Visibility>): <Error class: unknown class><List<MessageEntity>>
Link copied to clipboard
open suspend override fun observeMessageVisibility(messageUuid: String, conversationId: QualifiedIDEntity): <Error class: unknown class><MessageEntity.Visibility?>
Link copied to clipboard
open suspend override fun observeUnreadEvents(): <Error class: unknown class><Map<ConversationIDEntity, List<UnreadEventEntity>>>
Link copied to clipboard
open suspend override fun observeUnreadMessageCounter(): <Error class: unknown class><Map<ConversationIDEntity, Int>>
Link copied to clipboard
Link copied to clipboard
open suspend override fun promoteMessageToSentUpdatingServerTime(conversationId: ConversationIDEntity, messageUuid: String, serverDate: <Error class: unknown class>?, millis: Long): <Error class: unknown class>
Link copied to clipboard
open suspend override fun resetAssetTransferStatus(): <Error class: unknown class>
Link copied to clipboard
open override fun updateAssetMessage(message: MessageEntity)
Link copied to clipboard
open suspend override fun updateAssetTransferStatus(transferStatus: AssetTransferStatusEntity, id: String, conversationId: QualifiedIDEntity): <Error class: unknown class>
Link copied to clipboard
open suspend override fun updateLegalHoldMessageMembers(conversationId: QualifiedIDEntity, messageId: String, newMembers: List<QualifiedIDEntity>)
Link copied to clipboard
open suspend override fun updateMessagesStatus(status: MessageEntity.Status, id: List<String>, conversationId: QualifiedIDEntity): <Error class: unknown class>
Link copied to clipboard
open suspend override fun updateMessageStatus(status: MessageEntity.Status, id: String, conversationId: QualifiedIDEntity): <Error class: unknown class>
Link copied to clipboard
open suspend override fun updateSelfDeletionEndDate(conversationId: QualifiedIDEntity, messageId: String, selfDeletionEndDate: <Error class: unknown class>)
Link copied to clipboard
open suspend override fun updateTextMessageContent(editInstant: <Error class: unknown class>, conversationId: QualifiedIDEntity, currentMessageId: String, newTextContent: MessageEntityContent.Text, newMessageId: String)