updateItemTouchableState method

void updateItemTouchableState()

Implementation

void updateItemTouchableState() {
  if (currentUser.userRole.value == TUIRole.roomOwner) {
    isCameraItemTouchable.value = true;
    isMicItemTouchable.value = true;
    return;
  }
  if (currentUser.userRole.value == TUIRole.administrator) {
    if (isRoomNeedTakeSeat()) {
      if (currentUser.isOnSeat.value) {
        isCameraItemTouchable.value = true;
        isMicItemTouchable.value = true;
      } else {
        isCameraItemTouchable.value = false;
        isMicItemTouchable.value = false;
      }
      return;
    }
    isCameraItemTouchable.value = true;
    isMicItemTouchable.value = true;
    return;
  }
  if (isRoomNeedTakeSeat()) {
    if (currentUser.isOnSeat.value) {
      isCameraItemTouchable.value = true;
      isMicItemTouchable.value = true;
    } else {
      isCameraItemTouchable.value = false;
      isMicItemTouchable.value = false;
    }
  }
  if (roomInfo.isMicrophoneDisableForAllUser &&
      !currentUser.hasAudioStream.value) {
    isMicItemTouchable.value = false;
  } else {
    isMicItemTouchable.value = true;
  }
  if (roomInfo.isCameraDisableForAllUser &&
      !currentUser.hasVideoStream.value) {
    isCameraItemTouchable.value = false;
  } else {
    isCameraItemTouchable.value = true;
  }
}