isResendable method

bool isResendable()

Whether the message is resendable.

Implementation

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

  sbLog.i(StackTrace.current, 'return: $result');
  return result;
}