SendEditTextMessageUseCase

class SendEditTextMessageUseCase(messageRepository: MessageRepository, selfUserId: <Error class: unknown class>, provideClientId: CurrentClientIdProvider, slowSyncRepository: SlowSyncRepository, messageSender: MessageSender, messageSendFailureHandler: MessageSendFailureHandler, dispatchers: <Error class: unknown class> = KaliumDispatcherImpl)

Edits a text message

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 
   // Editing a simple text message
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
)
editTextMessageUseCase.invoke(
    conversationId = conversationId,
    text = "Hello",
    originalMessageId = originalMessageId,
    mentions = listOf(johnMention)
) 
   //sampleEnd
}

Constructors

Link copied to clipboard
internal constructor(messageRepository: MessageRepository, selfUserId: <Error class: unknown class>, provideClientId: CurrentClientIdProvider, slowSyncRepository: SlowSyncRepository, messageSender: MessageSender, messageSendFailureHandler: MessageSendFailureHandler, dispatchers: <Error class: unknown class> = KaliumDispatcherImpl)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend operator fun invoke(conversationId: <Error class: unknown class>, originalMessageId: String, text: String, mentions: List<<Error class: unknown class>> = emptyList(), editedMessageId: String = uuid4().toString()): Either<CoreFailure, Unit>

Operation to edit a text message.