resendFileMessage method

FileMessage resendFileMessage(
  1. FileMessage message,
  2. {required FileMessageCreateParams params,
  3. FileMessageHandler? handler,
  4. ProgressHandler? progressHandler}
)

Resends a file with given file information.

Implementation

FileMessage resendFileMessage(
  FileMessage message, {
  required FileMessageCreateParams params,
  FileMessageHandler? handler,
  ProgressHandler? progressHandler,
}) {
  sbLog.i(StackTrace.current,
      'params.uploadFile.name: ${params.fileInfo.fileName}');
  checkUnsupportedAction();

  if (message.sendingStatus != SendingStatus.failed) {
    throw InvalidParameterException();
  }
  if (message.channelUrl != channelUrl) {
    throw InvalidParameterException();
  }
  if (!message.isResendable()) {
    throw InvalidParameterException();
  }

  return sendFileMessage(
    params,
    progressHandler: progressHandler,
    handler: handler,
  );
}