resendUserMessage method

UserMessage resendUserMessage(
  1. UserMessage message,
  2. {UserMessageHandler? handler}
)

Resends a failed user message. message is a failed user message.

Implementation

UserMessage resendUserMessage(
  UserMessage message, {
  UserMessageHandler? handler,
}) {
  sbLog.i(StackTrace.current, 'message: $message');
  checkUnsupportedAction();

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

  final params =
      UserMessageCreateParams.withMessage(message, deepCopy: false);
  return sendUserMessage(
    params,
    handler: handler,
  );
}