copy File Message Flow
fun BaseChannel.copyFileMessageFlow(targetChannel: BaseChannel, fileMessage: FileMessage): Flow<MessageResult<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)
Content copied to clipboard
Return
The copied file message
Since
4.17.0
Parameters
target Channel
The target channel to copy file message
file Message
The file message to copy