Redirect participants to meeting ended screen instead of 404.
Deploy Ladill Meet / deploy (push) Successful in 49s
Deploy Ladill Meet / deploy (push) Successful in 49s
Poll and waiting-room clients follow the same redirect when the host ends the call; chat and participants use mobile bottom sheets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -181,8 +181,15 @@ class JoinController extends Controller
|
||||
{
|
||||
$room->loadMissing('organization');
|
||||
|
||||
$session = $room->activeSession();
|
||||
abort_unless($session?->isLive(), 404);
|
||||
$session = $room->activeSession() ?? $this->participantSessionForRoom($request, $room);
|
||||
|
||||
if (! $session || ! $session->isLive()) {
|
||||
if ($session) {
|
||||
return redirect()->route('meet.ended', $session);
|
||||
}
|
||||
|
||||
return redirect()->route('meet.join', $room);
|
||||
}
|
||||
|
||||
$participant = $this->participantFromSession($request, $session);
|
||||
|
||||
@@ -204,8 +211,18 @@ class JoinController extends Controller
|
||||
|
||||
public function waitingStatus(Request $request, Room $room): JsonResponse
|
||||
{
|
||||
$session = $room->activeSession();
|
||||
abort_unless($session, 404);
|
||||
$session = $room->activeSession() ?? $this->participantSessionForRoom($request, $room);
|
||||
|
||||
if (! $session || ! $session->isLive()) {
|
||||
if ($session) {
|
||||
return response()->json([
|
||||
'ended' => true,
|
||||
'redirect' => route('meet.ended', $session),
|
||||
]);
|
||||
}
|
||||
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$participant = $this->participantFromSession($request, $session);
|
||||
|
||||
@@ -230,4 +247,15 @@ class JoinController extends Controller
|
||||
->where('session_id', $session->id)
|
||||
->first();
|
||||
}
|
||||
|
||||
protected function participantSessionForRoom(Request $request, Room $room): ?Session
|
||||
{
|
||||
foreach ($room->sessions()->orderByDesc('started_at')->get() as $session) {
|
||||
if ($request->session()->has("meet.participant.{$session->uuid}")) {
|
||||
return $session;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user