UpdateConversationProtocolUseCase

Use case responsible for updating the protocol of a conversation, either locally or remotely.

If localOnly is true, the protocol is updated only in the local database. Otherwise, the change is performed through the backend, and the updated conversation is persisted locally using PersistConversationsUseCase if needed.

When the protocol changes to an MLS-capable one, the MLS group state is derived from CoreCrypto: GroupState.ESTABLISHED if this client already has the group, a pending state otherwise.

Return

Either.Right with true if the update was successful, or Either.Left if an error occurred.

Parameters

conversationId

ID of the conversation to update.

protocol

The new protocol to apply.

localOnly

If true, applies the protocol update locally without backend interaction.

Inheritors

Functions

Link copied to clipboard
abstract suspend operator fun invoke(transactionContext: CryptoTransactionContext, conversationId: ConversationId, protocol: Conversation.Protocol, localOnly: Boolean): Either<CoreFailure, Boolean>