checkSessionStatus method

void checkSessionStatus({
  1. bool asUser = false,
  2. Function? callBack,
})

Implementation

void checkSessionStatus({bool asUser = false, Function? callBack}) {
  networkRequestHandler(
      apiCall: () => apiClient.getSessionDetails(meetingDetails.meetingUid),
      onSuccess: (data) {
        if (data != null) {
          sessionId = data.id.toString();
        }

        if (data?.recordingConsentActive == 1) {
          if (asUser) {
            // Fetch consent list before checking consent
            getParticipantConsentList(onLoaded: () {
              if (!hasAlreadyAcceptedConsent()) {
                callBack?.call(); // Show dialog if not yet accepted
              }
            });
          } else {
            getParticipantConsentList();
          }
        } else {
          if (!asUser) {
            startRecordingConsent();
          }
        }
      },
      onError: (message) {
        sendMessageToUI(message);
      });
}