From 92a08653aad340949b83102e46504fedd54992ec Mon Sep 17 00:00:00 2001 From: Igor Loskutov Date: Thu, 19 Jun 2025 10:54:27 -0400 Subject: [PATCH] only recordings that are *recorded* require consent --- server/reflector/views/rooms.py | 3 ++- www/app/[roomName]/page.tsx | 9 ++++++++- www/app/api/schemas.gen.ts | 6 ++++++ www/app/api/types.gen.ts | 3 +++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/server/reflector/views/rooms.py b/server/reflector/views/rooms.py index f9f7f4eb..9592fa31 100644 --- a/server/reflector/views/rooms.py +++ b/server/reflector/views/rooms.py @@ -1,5 +1,5 @@ from datetime import datetime, timedelta -from typing import Annotated, Optional +from typing import Annotated, Optional, Literal import reflector.auth as auth from fastapi import APIRouter, Depends, HTTPException @@ -37,6 +37,7 @@ class Meeting(BaseModel): host_room_url: str start_date: datetime end_date: datetime + recording_type: Literal["none", "local", "cloud"] = "cloud" class CreateRoom(BaseModel): diff --git a/www/app/[roomName]/page.tsx b/www/app/[roomName]/page.tsx index 6e182d10..04e225b0 100644 --- a/www/app/[roomName]/page.tsx +++ b/www/app/[roomName]/page.tsx @@ -9,6 +9,7 @@ import { notFound } from "next/navigation"; import useSessionStatus from "../lib/useSessionStatus"; import { useRecordingConsent } from "../recordingConsentContext"; import useApi from "../lib/useApi"; +import { Meeting } from '../api'; export type RoomDetails = { params: { @@ -96,6 +97,10 @@ function ConsentDialog({ meetingId }: { meetingId: string }) { return <> } +const recordingTypeRequiresConsent = (recordingType: NonNullable) => { + return recordingType === 'cloud'; +} + export default function Room(details: RoomDetails) { const wherebyRef = useRef(null); const roomName = details.params.roomName; @@ -109,6 +114,8 @@ export default function Room(details: RoomDetails) { const meetingId = meeting?.response?.id; + const recordingType = meeting?.response?.recording_type; + const handleLeave = useCallback(() => { router.push("/browse"); }, [router]); @@ -165,7 +172,7 @@ export default function Room(details: RoomDetails) { room={roomUrl} style={{ width: "100vw", height: "100vh" }} /> - + {recordingType && recordingTypeRequiresConsent(recordingType) && } )} diff --git a/www/app/api/schemas.gen.ts b/www/app/api/schemas.gen.ts index fb0e65a3..8b42c8a7 100644 --- a/www/app/api/schemas.gen.ts +++ b/www/app/api/schemas.gen.ts @@ -546,6 +546,12 @@ export const $Meeting = { format: "date-time", title: "End Date", }, + recording_type: { + type: "string", + enum: ["none", "local", "cloud"], + title: "Recording Type", + default: "cloud", + }, }, type: "object", required: [ diff --git a/www/app/api/types.gen.ts b/www/app/api/types.gen.ts index c47eef74..38b77c69 100644 --- a/www/app/api/types.gen.ts +++ b/www/app/api/types.gen.ts @@ -108,8 +108,11 @@ export type Meeting = { host_room_url: string; start_date: string; end_date: string; + recording_type?: "none" | "local" | "cloud"; }; +export type recording_type = "none" | "local" | "cloud"; + export type MeetingConsentRequest = { consent_given: boolean; };