copyFileMessage

fun BaseChannel.copyFileMessage(targetChannel: BaseChannel, fileMessage: FileMessage): Flow<MessageResult<FileMessage>>

Deprecated

As of 4.17.0, replaced with copyFileMessageFlow(targetChannel, fileMessage).

Replace with

copyFileMessageFlow(targetChannel, fileMessage)

Copy file message

** Sample code **

baseChannel.copyFileMessageFlow(targetChannel, fileMessage)
.onEach {
when (it) {
is MessageResult.Pending -> {
// called it when sending message are called
// it contains pendingMessage
}
is MessageResult.Succeed -> {
// called it with result data when all job has been completed
}
is MessageResult.Failure -> {
// deliver exception with failed message when all job has been completed
// it.message : failed message
// it.e : exception
}
}
}.catch {
// error occurred (validation failed)
}.launchIn(viewModelScope)

Return

The copied file message

Since

4.15.0

Parameters

targetChannel

The target channel to copy file message

fileMessage

The file message to copy