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) : AddMemberToConversationUseCase
Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard
class CheckConversationInviteCodeUseCase(conversationGroupRepository: ConversationGroupRepository, conversationRepository: ConversationRepository, selfUserId: <Error class: unknown class>)

Checks if the conversation invite code is valid

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: <Error class: unknown class>, currentClientIdProvider: CurrentClientIdProvider, selfConversationIdProvider: SelfConversationIdProvider) : ClearConversationContentUseCase
Link copied to clipboard

Use case for clearing and drop orphaned typing indicators

Link copied to clipboard
internal class ClearUsersTypingEventsUseCaseImpl(typingIndicatorIncomingRepository: TypingIndicatorIncomingRepository, dispatcher: <Error class: unknown class> = KaliumDispatcherImpl) : ClearUsersTypingEventsUseCase
Link copied to clipboard
class ConversationScope(val conversationRepository: ConversationRepository, conversationGroupRepository: ConversationGroupRepository, connectionRepository: ConnectionRepository, userRepository: UserRepository, conversationFolderRepository: ConversationFolderRepository, syncManager: SyncManager, mlsConversationRepository: MLSConversationRepository, currentClientIdProvider: CurrentClientIdProvider, messageSender: MessageSender, teamRepository: TeamRepository, selfUserId: <Error class: unknown class>, selfConversationIdProvider: SelfConversationIdProvider, persistMessage: PersistMessageUseCase, updateKeyingMaterialThresholdProvider: UpdateKeyingMaterialThresholdProvider, selfTeamIdProvider: SelfTeamIdProvider, sendConfirmation: SendConfirmationUseCase, renamedConversationHandler: RenamedConversationEventHandler, qualifiedIdMapper: QualifiedIdMapper, serverConfigRepository: ServerConfigRepository, userStorage: UserStorage, userPropertyRepository: UserPropertyRepository, deleteEphemeralMessageEndDate: DeleteEphemeralMessagesAfterEndDateUseCase, oneOnOneResolver: OneOnOneResolver, scope: <Error class: unknown class>, kaliumLogger: <Error class: unknown class>, refreshUsersWithoutMetadata: RefreshUsersWithoutMetadataUseCase, serverConfigLinks: ServerConfig.Links, val dispatcher: <Error class: unknown class> = KaliumDispatcherImpl)
Link copied to clipboard
internal interface ConversationsRecoveryManager
Link copied to clipboard
internal class ConversationsRecoveryManagerImpl(incrementalSyncRepository: IncrementalSyncRepository, addSystemMessageToAllConversationsUseCase: AddSystemMessageToAllConversationsUseCase, slowSyncRepository: SlowSyncRepository, kaliumLogger: <Error class: unknown class>) : ConversationsRecoveryManager
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class CreateGroupConversationUseCase(conversationRepository: ConversationRepository, conversationGroupRepository: ConversationGroupRepository, syncManager: SyncManager, currentClientIdProvider: CurrentClientIdProvider, newGroupConversationSystemMessagesCreator: NewGroupConversationSystemMessagesCreator, refreshUsersWithoutMetadata: RefreshUsersWithoutMetadataUseCase)

Creates a group conversation. Will wait for sync to finish or fail if it is pending, and return one Result.

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: <Error class: unknown class> = KaliumDispatcherImpl) : GetConversationUnreadEventsCountUseCase
Link copied to clipboard
class GetConversationUseCase(conversationRepository: ConversationRepository)

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

Link copied to clipboard
class GetOneToOneConversationUseCase(conversationRepository: ConversationRepository, dispatchers: <Error class: unknown class> = 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.

class GetPaginatedFlowOfConversationDetailsWithEventsBySearchQueryUseCase(dispatcher: <Error class: unknown class>, conversationRepository: ConversationRepository)

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

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 JoinConversationViaCodeUseCase(conversionsGroupRepository: ConversationGroupRepository, selfUserId: <Error class: unknown class>)

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

Link copied to clipboard
Link copied to clipboard
internal class LeaveConversationUseCaseImpl(conversationGroupRepository: ConversationGroupRepository, selfUserId: <Error class: unknown class>) : LeaveConversationUseCase
Link copied to clipboard
class MembersToMentionUseCase(observeConversationMembers: ObserveConversationMembersUseCase, userRepository: UserRepository, dispatcher: <Error class: unknown class> = 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
Link copied to clipboard
internal class MLSConversationsRecoveryManagerImpl(featureSupport: FeatureSupport, incrementalSyncRepository: IncrementalSyncRepository, clientRepository: ClientRepository, recoverMLSConversationsUseCase: RecoverMLSConversationsUseCase, slowSyncRepository: SlowSyncRepository, kaliumLogger: <Error class: unknown class>) : MLSConversationsRecoveryManager
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, kaliumLogger: <Error class: unknown class>) : 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: <Error class: unknown class> = KaliumDispatcherImpl)

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

class ObserveConversationInteractionAvailabilityUseCase(conversationRepository: ConversationRepository, userRepository: UserRepository, dispatcher: <Error class: unknown class> = 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.

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

Link copied to clipboard
internal class ObserveIsSelfUserMemberUseCaseImpl(conversationRepository: ConversationRepository, selfUserId: <Error class: unknown class>) : ObserveIsSelfUserMemberUseCase
internal class ObserveOtherUserSecurityClassificationLabelUseCaseImpl(userConfigRepository: UserConfigRepository, selfUserId: <Error class: unknown class>, dispatchers: <Error class: unknown class> = 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: <Error class: unknown class> = KaliumDispatcherImpl) : ObserveUsersTypingUseCase
Link copied to clipboard

Persists a list of conversations migrated from old clients Use carefully since normal conversations should come from the backend sync process

Link copied to clipboard
internal class PersistMigratedConversationUseCaseImpl(selfUserId: <Error class: unknown class>, migrationDAO: <Error class: unknown class>, conversationMapper: ConversationMapper = MapperProvider.conversationMapper(selfUserId)) : PersistMigratedConversationUseCase
Link copied to clipboard
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) : RecoverMLSConversationsUseCase

Refresh conversations without metadata, only if necessary.

internal class RefreshConversationsWithoutMetadataUseCaseImpl(conversationRepository: ConversationRepository, dispatchers: <Error class: unknown class> = 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: <Error class: unknown class>, 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: <Error class: unknown class> = 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) : SyncConversationsUseCase

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

Link copied to clipboard
internal class TypingIndicatorSyncManager(typingIndicatorIncomingRepository: <Error class: unknown class><TypingIndicatorIncomingRepository>, observeSyncStateUseCase: ObserveSyncStateUseCase, kaliumLogger: <Error class: unknown class>)
Link copied to clipboard
class UpdateConversationAccessRoleUseCase(conversationRepository: ConversationRepository, conversationGroupRepository: ConversationGroupRepository, syncManager: SyncManager)

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
class UpdateConversationReadDateUseCase(conversationRepository: ConversationRepository, messageSender: MessageSender, currentClientIdProvider: CurrentClientIdProvider, selfUserId: <Error class: unknown class>, selfConversationIdProvider: SelfConversationIdProvider, sendConfirmation: SendConfirmationUseCase, workQueue: ConversationWorkQueue, logger: <Error class: unknown class> = 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
internal class UpdateConversationReceiptModeUseCaseImpl(conversationRepository: ConversationRepository, persistMessage: PersistMessageUseCase, selfUserId: <Error class: unknown class>) : UpdateConversationReceiptModeUseCase

Properties

Link copied to clipboard
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
val NON_ALPHANUMERIC_REGEX: <Error class: unknown class>

Functions

Link copied to clipboard
internal fun GetConversationProtocolInfoUseCase(conversationRepository: ConversationRepository, dispatcher: <Error class: unknown class> = KaliumDispatcherImpl): GetConversationProtocolInfoUseCase