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:
@@ -77,4 +77,50 @@ class LeaveController extends Controller
|
||||
'organization' => $session->room->organization,
|
||||
]);
|
||||
}
|
||||
|
||||
public function ended(Request $request, Session $session): View|RedirectResponse
|
||||
{
|
||||
$session->loadMissing('room.organization');
|
||||
abort_unless($session->room, 404);
|
||||
|
||||
if ($session->isLive()) {
|
||||
return redirect()->route('meet.room', $session);
|
||||
}
|
||||
|
||||
$canGiveFeedback = $this->prepareFeedbackSession($request, $session);
|
||||
|
||||
return view('meet.ended.show', [
|
||||
'session' => $session,
|
||||
'room' => $session->room,
|
||||
'organization' => $session->room->organization,
|
||||
'canGiveFeedback' => $canGiveFeedback,
|
||||
]);
|
||||
}
|
||||
|
||||
public function prepareFeedbackSession(Request $request, Session $session): bool
|
||||
{
|
||||
$participantUuid = $request->session()->get("meet.participant.{$session->uuid}");
|
||||
|
||||
if ($participantUuid) {
|
||||
$participant = Participant::where('uuid', $participantUuid)
|
||||
->where('session_id', $session->id)
|
||||
->first();
|
||||
|
||||
if ($participant) {
|
||||
$request->session()->put('meet.left.feedback', [
|
||||
'session_uuid' => $session->uuid,
|
||||
'participant_uuid' => $participant->uuid,
|
||||
'display_name' => $participant->display_name,
|
||||
'user_ref' => $participant->user_ref,
|
||||
]);
|
||||
$request->session()->forget("meet.participant.{$session->uuid}");
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$feedback = (array) $request->session()->get('meet.left.feedback', []);
|
||||
|
||||
return ($feedback['session_uuid'] ?? null) === $session->uuid;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user