SendButtonMessageUseCase

class SendButtonMessageUseCase(persistMessage: PersistMessageUseCase, selfUserId: <Error class: unknown class>, provideClientId: CurrentClientIdProvider, slowSyncRepository: SlowSyncRepository, messageSender: MessageSender, messageSendFailureHandler: MessageSendFailureHandler, userPropertyRepository: UserPropertyRepository, 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, slowSyncRepository: SlowSyncRepository, messageSender: MessageSender, messageSendFailureHandler: MessageSendFailureHandler, userPropertyRepository: UserPropertyRepository, 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, mentions: List<<Error class: unknown class>> = emptyList(), quotedMessageId: String? = null, buttons: List<String> = listOf()): Either<CoreFailure, Unit>