Package-level declarations

Types

Link copied to clipboard

This use case will add a member(s) to a given conversation.

Link copied to clipboard
internal class AddMemberToConversationUseCaseImpl(conversationGroupRepository: ConversationGroupRepository, userRepository: UserRepository, refreshUsersWithoutMetadata: RefreshUsersWithoutMetadataUseCase, resetMLSConversation: ResetMLSConversationUseCase) : AddMemberToConversationUseCase
Link copied to clipboard

This use case will add a service to a given conversation.

Link copied to clipboard
data class AdminlessConversationFailure(val eligibleMembers: List<UserId>) : CoreFailure.FeatureFailure
Link copied to clipboard
Link copied to clipboard
class CheckConversationInviteCodeUseCase(conversationGroupRepository: ConversationGroupRepository, conversationRepository: ConversationRepository, selfUserId: UserId)

Checks if the conversation invite code is valid

Link copied to clipboard

Checks whether the self user is allowed to leave the given group conversation.

Link copied to clipboard

Checks whether the active one-to-one conversation with otherUserId is ready to be opened. Proteus conversations are ready once present locally. MLS conversations are ready only when their group exists in Core Crypto.

Link copied to clipboard
Link copied to clipboard

This use case will clear all messages from a conversation and notify other clients, using the self conversation.

Link copied to clipboard
internal class ClearConversationContentUseCaseImpl(conversationRepository: ConversationRepository, messageSender: MessageSender, selfUserId: UserId, currentClientIdProvider: CurrentClientIdProvider, selfConversationIdProvider: SelfConversationIdProvider, clearLocalConversationAssets: ClearConversationAssetsLocallyUseCase, persistenceEventHookNotifier: PersistenceEventHookNotifier) : ClearConversationContentUseCase
Link copied to clipboard

Use case for clearing and drop orphaned typing indicators

Link copied to clipboard
internal class ClearUsersTypingEventsUseCaseImpl(typingIndicatorIncomingRepository: TypingIndicatorIncomingRepository, dispatcher: KaliumDispatcher = KaliumDispatcherImpl) : ClearUsersTypingEventsUseCase
Link copied to clipboard
class ConversationScope(val conversationRepository: ConversationRepository, val callRepository: CallRepository, conversationGroupRepository: ConversationGroupRepository, connectionRepository: ConnectionRepository, userRepository: UserRepository, conversationFolderRepository: ConversationFolderRepository, syncManager: SyncManager, mlsConversationRepository: MLSConversationRepository, currentClientIdProvider: CurrentClientIdProvider, messageSender: MessageSender, teamRepository: TeamRepository, slowSyncRepository: SlowSyncRepository, val selfUserId: UserId, selfConversationIdProvider: SelfConversationIdProvider, persistMessage: PersistMessageUseCase, val selfTeamIdProvider: SelfTeamIdProvider, sendConfirmation: SendConfirmationUseCase, renamedConversationHandler: RenamedConversationEventHandler, serverConfigRepository: ServerConfigRepository, userStorage: UserStorage, userPropertyRepository: UserPropertyRepository, deleteEphemeralMessageEndDate: DeleteEphemeralMessagesAfterEndDateUseCase, oneOnOneResolver: OneOnOneResolver, scope: CoroutineScope, kaliumLogger: KaliumLogger, refreshUsersWithoutMetadata: RefreshUsersWithoutMetadataUseCase, serverConfigLinks: ServerConfig.Links, val messageRepository: MessageRepository, val assetRepository: AssetRepository, newGroupConversationSystemMessagesCreator: NewGroupConversationSystemMessagesCreator, deleteConversationUseCase: DeleteConversationUseCase, persistConversationsUseCase: PersistConversationsUseCase, transactionProvider: CryptoTransactionProvider, resetMLSConversationUseCase: ResetMLSConversationUseCase, systemMessageInserter: SystemMessageInserter, persistenceEventHookNotifier: PersistenceEventHookNotifier, memberJoinEventHandler: MemberJoinEventHandler, joinExistingMLSConversation: JoinExistingMLSConversationUseCase, pendingActionsRepository: PendingActionsRepository, val dispatcher: KaliumDispatcher)
Link copied to clipboard
internal interface ConversationsRecoveryManager
Link copied to clipboard
internal class ConversationsRecoveryManagerImpl(incrementalSyncRepository: IncrementalSyncRepository, addSystemMessageToAllConversationsUseCase: AddSystemMessageToAllConversationsUseCase, slowSyncRepository: SlowSyncRepository, kaliumLogger: KaliumLogger) : ConversationsRecoveryManager
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Operation that fetches all known users which are not a part of a given conversation conversationId

Link copied to clipboard

This use case that get Conversation.ProtocolInfo for a specific conversation.

Link copied to clipboard
class GetConversationsUseCase(conversationRepository: ConversationRepository)

This use case will observe and return the conversation list for the current user. Prefer using ObserveConversationListDetailsUseCase instead, since is performance efficient, relying on sql views.

Link copied to clipboard

UseCase for getting once the amount of unread events (all: messages, pings, missed calls, etc.) in a specific conversation.

internal class GetConversationUnreadEventsCountUseCaseImpl(conversationRepository: ConversationRepository, dispatcher: KaliumDispatcher = KaliumDispatcherImpl) : GetConversationUnreadEventsCountUseCase
Link copied to clipboard
internal class GetConversationUseCase(conversationRepository: ConversationRepository)

This use case will observe and return the conversation model for a specific conversation.

Link copied to clipboard
class GetOneToOneConversationDetailsUseCase(conversationRepository: ConversationRepository, dispatchers: KaliumDispatcher = KaliumDispatcherImpl)

Operation that returns Conversation data for the one-to-one conversation with specific UserId.

Link copied to clipboard

Operation that creates one-to-one Conversation with specific UserId (only if it is absent in local DB) and returns Conversation data.

internal class GetOrCreateOneToOneConversationUseCaseImpl(conversationRepository: ConversationRepository, userRepository: UserRepository, oneOnOneResolver: OneOnOneResolver, transactionProvider: CryptoTransactionProvider, checkOneToOneConversationIsReady: CheckOneToOneConversationIsReadyUseCase) : GetOrCreateOneToOneConversationUseCase
class GetPaginatedFlowOfConversationDetailsWithEventsBySearchQueryUseCase(dispatcher: KaliumDispatcher, conversationRepository: ConversationRepository, callRepository: CallRepository)

This use case will observe and return a flow of paginated searched conversation details with last message and unread events counts.

class GetPaginatedFlowOfConversationDetailsWithMembersBySearchQueryUseCase(dispatcher: KaliumDispatcher, conversationRepository: ConversationRepository, selfTeamIdProvider: SelfTeamIdProvider, selfUserId: UserId)

Searches joined groups and channels, loading members in batches for each page.

Link copied to clipboard
Link copied to clipboard

Operation that indicates if we have one-o-one Conversation with specific UserId.

Link copied to clipboard
Link copied to clipboard
class IsSelfUserViewerOnConversationUseCase(conversationRepository: ConversationRepository, selfTeamIdProvider: SelfTeamIdProvider, dispatcher: KaliumDispatcher = KaliumDispatcherImpl)

Use case to check whether the self user has viewer access to a drive conversation.

Link copied to clipboard
class JoinConversationViaCodeUseCase(conversionsGroupRepository: ConversationGroupRepository, conversationRepository: ConversationRepository, memberJoinEventHandler: MemberJoinEventHandler, joinExistingMLSConversation: JoinExistingMLSConversationUseCase, mlsConversationRepository: MLSConversationRepository, transactionProvider: CryptoTransactionProvider, selfUserId: UserId, eventMapper: EventMapper = MapperProvider.eventMapper(selfUserId))

Use case for joining a conversation via a code invite code. the param can be obtained from the deep link

Link copied to clipboard

Joins pending MLS conversations by external commit after this client may have been left out of MLS groups: it ran out of key packages, or it registered its MLS client after conversations were migrated to MLS.

Link copied to clipboard
internal class JoinPendingMLSConversationsManagerImpl(incrementalSyncRepository: IncrementalSyncRepository, userConfigRepository: UserConfigRepository, joinExistingMLSConversations: JoinExistingMLSConversationsUseCase, kaliumLogger: KaliumLogger) : JoinPendingMLSConversationsManager
Link copied to clipboard
Link copied to clipboard
internal class LeaveConversationUseCaseImpl(conversationGroupRepository: ConversationGroupRepository, selfUserId: UserId) : LeaveConversationUseCase
Link copied to clipboard

Use case to immediately update the conversation read date in the local database

Link copied to clipboard
internal class MarkConversationAsReadLocallyUseCaseImpl(conversationRepository: ConversationRepository, persistenceEventHookNotifier: PersistenceEventHookNotifier, selfUserId: UserId, logger: KaliumLogger = kaliumLogger) : MarkConversationAsReadLocallyUseCase
Link copied to clipboard
Link copied to clipboard
class MembersToMentionUseCase(observeConversationMembers: ObserveConversationMembersUseCase, selfUserId: UserId, dispatcher: KaliumDispatcher = KaliumDispatcherImpl)

This usecase returns a list of members to mention for a given conversation based on a search done with searchQuery The result should ordered respecting this order of priorities:

Link copied to clipboard

This use case will migrate a given conversation to use the MLS protocol

Link copied to clipboard
internal class MigrateConversationToMLSUseCaseImpl(val mlsMigrator: MLSMigrator, val conversationRepository: ConversationRepository, val coreCryptoTransactionProvider: CryptoTransactionProvider) : MigrateConversationToMLSUseCase
Link copied to clipboard
Link copied to clipboard
internal class MLSConversationsRecoveryManagerImpl(featureSupport: FeatureSupport, incrementalSyncRepository: IncrementalSyncRepository, clientRepository: ClientRepository, recoverMLSConversationsUseCase: RecoverMLSConversationsUseCase, slowSyncRepository: SlowSyncRepository, transactionProvider: CryptoTransactionProvider, kaliumLogger: KaliumLogger) : MLSConversationsRecoveryManager
Link copied to clipboard

Internal use case to repair conversations with faulty MLS keys based on known faulty keys per domain. This is intended to be run once after an app update that includes the fix for the faulty keys.

internal class MLSFaultyKeysConversationsRepairUseCaseImpl(selfUserId: UserId, syncStateObserver: SyncStateObserver, kaliumConfigs: KaliumConfigs, userConfigRepository: UserConfigRepository, repairFaultyRemovalKeys: RepairFaultyRemovalKeysUseCase, kaliumLogger: KaliumLogger) : MLSFaultyKeysConversationsRepairUseCase
Link copied to clipboard

Used by the UI to notify Kalium that a conversation is open. It's useful so Kalium can lazily perform update operations and make sure that the conversation is up-to-date when the user opens it.

Link copied to clipboard
internal class NotifyConversationIsOpenUseCaseImpl(oneOnOneResolver: OneOnOneResolver, conversationRepository: ConversationRepository, deleteEphemeralMessageEndDate: DeleteEphemeralMessagesAfterEndDateUseCase, slowSyncRepository: SlowSyncRepository, transactionProvider: CryptoTransactionProvider, kaliumLogger: KaliumLogger, dispatcher: KaliumDispatcher = KaliumDispatcherImpl) : NotifyConversationIsOpenUseCase

UseCase for observing the count of archived conversations that have unread events (e.g., messages, pings, missed calls). The result is presented as a continuous flow, updating whenever the count changes.

Link copied to clipboard
class ObserveConversationDetailsUseCase(conversationRepository: ConversationRepository, dispatcher: KaliumDispatcher = KaliumDispatcherImpl)

This use case will observe and return the conversation details for a specific conversation.

class ObserveConversationInteractionAvailabilityUseCase(conversationRepository: ConversationRepository, userRepository: UserRepository, selfUserId: UserId, selfClientIdProvider: CurrentClientIdProvider, dispatcher: KaliumDispatcher = KaliumDispatcherImpl)

Use case that check if self user is able to interact in conversation.

Link copied to clipboard

This use case will observe and return the list of conversation details for the current user.

This use case will observe and return the list of conversation details for the current user.

Link copied to clipboard

This use case will observe and return the list of members of a given conversation.

Link copied to clipboard

UseCase for observing if User was notified about conversation being subject of legal hold

UseCase for observing if User was notified about verification degrading of conversation

Observes the list of conversation members that are eligible to be promoted to admin role.

Link copied to clipboard
Link copied to clipboard
internal class ObserveOtherUserSecurityClassificationLabelUseCaseImpl(userConfigRepository: UserConfigRepository, selfUserId: UserId, dispatchers: KaliumDispatcher = KaliumDispatcherImpl) : ObserveOtherUserSecurityClassificationLabelUseCase
Link copied to clipboard

This use case will observe and return the list of users objects, contacts and connections. Using a list of user ids to obverse.

Link copied to clipboard

Use case for observing current users typing in a given conversation. This will get their info details from the local database.

Link copied to clipboard
internal class ObserveUsersTypingUseCaseImpl(typingIndicatorIncomingRepository: TypingIndicatorIncomingRepository, userRepository: UserRepository, dispatcher: KaliumDispatcher = KaliumDispatcherImpl) : ObserveUsersTypingUseCase
Link copied to clipboard
Link copied to clipboard

Recovers the self user's MLS conversations after synchronization is live. Established groups are checked first, then pending groups are joined in a fresh transaction.

Link copied to clipboard
internal sealed class RecoverMLSConversationsResult
Link copied to clipboard

Iterate over all MLS Established conversations after 404 sync error and check for out of sync epochs, if out of sync then it tries to re-join.

Link copied to clipboard
internal class RecoverMLSConversationsUseCaseImpl(featureSupport: FeatureSupport, clientRepository: ClientRepository, conversationRepository: ConversationRepository, mlsConversationRepository: MLSConversationRepository, joinExistingMLSConversationUseCase: JoinExistingMLSConversationUseCase, selfUserId: UserId) : RecoverMLSConversationsUseCase

Refresh conversations without metadata, only if necessary.

internal class RefreshConversationsWithoutMetadataUseCaseImpl(conversationRepository: ConversationRepository, persistConversations: PersistConversationsUseCase, transactionProvider: CryptoTransactionProvider, dispatchers: KaliumDispatcher = KaliumDispatcherImpl) : RefreshConversationsWithoutMetadataUseCase
Link copied to clipboard

Renames a conversation by its ID.

Link copied to clipboard
internal class RenameConversationUseCaseImpl(val conversationRepository: ConversationRepository, val persistMessage: PersistMessageUseCase, renamedConversationEventHandler: RenamedConversationEventHandler, val selfUserId: UserId, eventMapper: EventMapper = MapperProvider.eventMapper(selfUserId)) : RenameConversationUseCase
Link copied to clipboard
sealed class RenamingResult
Link copied to clipboard
sealed class Result
Link copied to clipboard

UseCase for sending a typing event to a specific ConversationId

Link copied to clipboard
internal class SendTypingEventUseCaseImpl(typingIndicatorRepository: TypingIndicatorOutgoingRepository, dispatcher: KaliumDispatcher = KaliumDispatcherImpl) : SendTypingEventUseCase

UseCase for setting legal_hold_change_notified flag to true, it means that User was notified about the recent change in legal hold status.

Link copied to clipboard

UseCase for setting DegradedConversationNotified flag to true, means user was notified about verification changes and no need to do it again.

Link copied to clipboard
class SyncConversationCodeUseCase(conversationGroupRepository: ConversationGroupRepository, serverConfigLinks: ServerConfig.Links)

Use case to sync the conversation code. This use case is used to update the conversation code in the database.

Link copied to clipboard
internal interface SyncConversationsUseCase
Link copied to clipboard
internal class SyncConversationsUseCaseImpl(conversationRepository: ConversationRepository, systemMessageInserter: SystemMessageInserter, fetchConversations: FetchConversationsUseCase, transactionProvider: CryptoTransactionProvider) : SyncConversationsUseCase

This use case will sync against the backend the conversations of the current user.

Link copied to clipboard
internal class TypingIndicatorSyncManager(typingIndicatorIncomingRepository: Lazy<TypingIndicatorIncomingRepository>, observeSyncStateUseCase: ObserveSyncStateUseCase, kaliumLogger: KaliumLogger)
Link copied to clipboard

This use case will update the access and access role configuration of a conversation. So we can operate and allow or not operation based on these roles:

Link copied to clipboard
internal class UpdateConversationAccessRoleUseCaseImpl(conversationRepository: ConversationRepository, conversationGroupRepository: ConversationGroupRepository, syncManager: SyncManager) : UpdateConversationAccessRoleUseCase
Link copied to clipboard
Link copied to clipboard
class UpdateConversationReadDateUseCase(conversationRepository: ConversationRepository, messageSender: MessageSender, currentClientIdProvider: CurrentClientIdProvider, selfUserId: UserId, selfConversationIdProvider: SelfConversationIdProvider, sendConfirmation: SendConfirmationUseCase, workQueue: ConversationWorkQueue, persistenceEventHookNotifier: PersistenceEventHookNotifier, logger: KaliumLogger = kaliumLogger)

This use case will update last read date for a conversation. After that, will sync against other user's registered clients, using the self conversation.

Link copied to clipboard

Internal UseCase that updates Group Conversation Receipt Mode value Possible values: Conversation.ReceiptMode.ENABLED and Conversation.ReceiptMode.DISABLED Returns: ConversationUpdateReceiptModeResult

Link copied to clipboard

Properties

Link copied to clipboard
internal val nameTokens: (String) -> List<String>

Split the name in tokens. Any character that is not a alphanumeric character is a separator (e.g. (space), -, !, 🤣 and so on)

Link copied to clipboard
internal val NON_ALPHANUMERIC_REGEX: Regex

Functions

Link copied to clipboard
internal fun GetConversationProtocolInfoUseCase(conversationRepository: ConversationRepository, dispatcher: KaliumDispatcher = KaliumDispatcherImpl): GetConversationProtocolInfoUseCase
Link copied to clipboard
internal fun List<ConversationDetailsWithEvents>.withJoinableCallsOnTop(joinableCallConversationIds: Set<ConversationId>, moveJoinableCallsOnTop: Boolean = true): List<ConversationDetailsWithEvents>