SendTextMessageUseCase

class SendTextMessageUseCase(persistMessage: PersistMessageUseCase, messageDraftRepository: MessageDraftRepository, selfUserId: QualifiedID, provideClientId: CurrentClientIdProvider, assetDataSource: AssetRepository, slowSyncRepository: SlowSyncRepository, messageSender: MessageSender, messageSendFailureHandler: MessageSendFailureHandler, userPropertyRepository: UserPropertyRepository, selfDeleteTimer: ObserveSelfDeletionTimerSettingsForConversationUseCase, dispatchers: KaliumDispatcher = KaliumDispatcherImpl, pendingMessagesEnabled: Boolean = true, scope: CoroutineScope)

Samples

samples.logic.MessageUseCases.sendingBasicTextMessagesamples.logic.MessageUseCases.sendingTextMessageWithMentions

Constructors

Link copied to clipboard
internal constructor(persistMessage: PersistMessageUseCase, messageDraftRepository: MessageDraftRepository, selfUserId: QualifiedID, provideClientId: CurrentClientIdProvider, assetDataSource: AssetRepository, slowSyncRepository: SlowSyncRepository, messageSender: MessageSender, messageSendFailureHandler: MessageSendFailureHandler, userPropertyRepository: UserPropertyRepository, selfDeleteTimer: ObserveSelfDeletionTimerSettingsForConversationUseCase, dispatchers: KaliumDispatcher = KaliumDispatcherImpl, pendingMessagesEnabled: Boolean = true, scope: CoroutineScope)

Types

Link copied to clipboard
internal object Companion

Functions

Link copied to clipboard
suspend operator fun invoke(conversationId: ConversationId, text: String, linkPreviews: List<MessageLinkPreview> = emptyList(), mentions: List<MessageMention> = emptyList(), quotedMessageId: String? = null, draftRevision: Long? = null): MessageOperationResult
Link copied to clipboard
internal suspend fun store(messageId: String, conversationId: ConversationId, text: String): Boolean

Stores text as messageId in the caller's coroutine and returns whether it was stored; only sending goes on in the session's scope. Cancelled before the message is stored, it stores and sends nothing. A caller that may repeat itself checks for the message first (ADR 13).