isResendable method

bool isResendable()

Returns true if this message can be resend.

Implementation

bool isResendable() {
  final resendableError = errorCode == ErrorCode.connectionRequired ||
      errorCode == ErrorCode.networkError ||
      errorCode == ErrorCode.ackTimeout ||
      errorCode == ErrorCode.webSocketConnectionClosed ||
      errorCode == ErrorCode.webSocketConnectionFailed ||
      errorCode == ErrorCode.fileUploadTimeout ||
      errorCode == ErrorCode.fileUploadCanceled ||
      errorCode == ErrorCode.internalServerError ||
      errorCode == ErrorCode.rateLimitExceeded ||
      errorCode == ErrorCode.socketTooManyMessages ||
      errorCode == ErrorCode.pendingError;
  if (resendableError &&
      (sendingStatus == MessageSendingStatus.failed ||
          sendingStatus == MessageSendingStatus.canceled)) {
    return true;
  }
  return false;
}