SendTextMessageUseCase

class SendTextMessageUseCase(persistMessage: PersistMessageUseCase, selfUserId: <Error class: unknown class>, provideClientId: CurrentClientIdProvider, assetDataSource: AssetRepository, slowSyncRepository: SlowSyncRepository, messageSender: MessageSender, messageSendFailureHandler: MessageSendFailureHandler, userPropertyRepository: UserPropertyRepository, selfDeleteTimer: ObserveSelfDeletionTimerSettingsForConversationUseCase, dispatchers: <Error class: unknown class> = KaliumDispatcherImpl, scope: <Error class: unknown class>)

Samples

import com.wire.kalium.logic.data.id.ConversationId
import com.wire.kalium.logic.data.message.mention.MessageMention
import com.wire.kalium.logic.data.user.UserId
import com.wire.kalium.logic.feature.message.SendEditTextMessageUseCase
import com.wire.kalium.logic.feature.message.SendTextMessageUseCase
fun main() { 
   //sampleStart 
   // Sending a simple text message
sendTextMessageUseCase.invoke(
    conversationId = conversationId,
    text = "Hello"
) 
   //sampleEnd
}
import com.wire.kalium.logic.data.id.ConversationId
import com.wire.kalium.logic.data.message.mention.MessageMention
import com.wire.kalium.logic.data.user.UserId
import com.wire.kalium.logic.feature.message.SendEditTextMessageUseCase
import com.wire.kalium.logic.feature.message.SendTextMessageUseCase
fun main() { 
   //sampleStart 
   // Sending a text message with mention
val text = "Hello, @John"
val johnMention = MessageMention(
    start = 8, // The index of the @ in the text above
    length = 5, // The length of the mention (including the @)
    userId = johnUserId, // ID of the user being mentioned
    isSelfMention = selfUserId == johnUserId // Whether the mention is for the current user
)
sendTextMessageUseCase.invoke(
    conversationId = conversationId,
    text = text,
    mentions = listOf(johnMention)
) 
   //sampleEnd
}

Constructors

Link copied to clipboard
internal constructor(persistMessage: PersistMessageUseCase, selfUserId: <Error class: unknown class>, provideClientId: CurrentClientIdProvider, assetDataSource: AssetRepository, slowSyncRepository: SlowSyncRepository, messageSender: MessageSender, messageSendFailureHandler: MessageSendFailureHandler, userPropertyRepository: UserPropertyRepository, selfDeleteTimer: ObserveSelfDeletionTimerSettingsForConversationUseCase, dispatchers: <Error class: unknown class> = KaliumDispatcherImpl, scope: <Error class: unknown class>)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend operator fun invoke(conversationId: <Error class: unknown class>, text: String, linkPreviews: List<<Error class: unknown class>> = emptyList(), mentions: List<<Error class: unknown class>> = emptyList(), quotedMessageId: String? = null): Either<CoreFailure, Unit>