Add live speaker invites for audio rooms and simplify the toolbar.
Deploy Ladill Meet / deploy (push) Successful in 1m9s
Deploy Ladill Meet / deploy (push) Successful in 1m9s
Let hosts promote raised-hand listeners from People, remove the empty More menu in spaces, and put People and recording on the bottom bar. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -252,6 +252,36 @@ class MeetingRoomController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function promoteSpaceSpeaker(Request $request, Session $session, Participant $participant): JsonResponse
|
||||
{
|
||||
$actor = $this->currentParticipant($request, $session);
|
||||
abort_unless($participant->session_id === $session->id, 404);
|
||||
abort_unless($session->room->isSpace(), 404);
|
||||
abort_unless($actor->isHost() || ($request->user() && $request->user()->ownerRef() === $session->room->host_user_ref), 403);
|
||||
|
||||
$updated = app(SpaceService::class)->promoteToSpeaker($session->room, $participant);
|
||||
$avatars = ParticipantPresenter::avatarMap($session->participants()->get(), $session->room->host_user_ref);
|
||||
|
||||
return response()->json([
|
||||
'participant' => ParticipantPresenter::toArray($updated, $avatars, $session->room->host_user_ref),
|
||||
]);
|
||||
}
|
||||
|
||||
public function demoteSpaceSpeaker(Request $request, Session $session, Participant $participant): JsonResponse
|
||||
{
|
||||
$actor = $this->currentParticipant($request, $session);
|
||||
abort_unless($participant->session_id === $session->id, 404);
|
||||
abort_unless($session->room->isSpace(), 404);
|
||||
abort_unless($actor->isHost() || ($request->user() && $request->user()->ownerRef() === $session->room->host_user_ref), 403);
|
||||
|
||||
$updated = app(SpaceService::class)->demoteFromSpeaker($session->room, $participant);
|
||||
$avatars = ParticipantPresenter::avatarMap($session->participants()->get(), $session->room->host_user_ref);
|
||||
|
||||
return response()->json([
|
||||
'participant' => ParticipantPresenter::toArray($updated, $avatars, $session->room->host_user_ref),
|
||||
]);
|
||||
}
|
||||
|
||||
public function sendMessage(Request $request, Session $session): JsonResponse
|
||||
{
|
||||
abort_unless(app(SpaceService::class)->allowsRoomFeature($session->room, 'chat'), 422);
|
||||
|
||||
@@ -71,4 +71,54 @@ class SpaceService
|
||||
'lock',
|
||||
], true);
|
||||
}
|
||||
|
||||
public function promoteToSpeaker(Room $room, Participant $participant): Participant
|
||||
{
|
||||
abort_unless($room->isSpace(), 422);
|
||||
abort_unless(in_array($participant->role, ['attendee', 'guest', 'participant'], true), 422);
|
||||
|
||||
$participant->update([
|
||||
'role' => 'panelist',
|
||||
'hand_raised' => false,
|
||||
]);
|
||||
|
||||
if ($participant->user_ref) {
|
||||
$speakerRefs = collect((array) $room->setting('speaker_refs', []))
|
||||
->push($participant->user_ref)
|
||||
->unique()
|
||||
->values()
|
||||
->all();
|
||||
|
||||
$room->update([
|
||||
'settings' => array_merge($room->settings ?? [], [
|
||||
'speaker_refs' => $speakerRefs,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
return $participant->fresh();
|
||||
}
|
||||
|
||||
public function demoteFromSpeaker(Room $room, Participant $participant): Participant
|
||||
{
|
||||
abort_unless($room->isSpace(), 422);
|
||||
abort_unless($participant->role === 'panelist', 422);
|
||||
|
||||
$participant->update(['role' => 'attendee']);
|
||||
|
||||
if ($participant->user_ref) {
|
||||
$speakerRefs = collect((array) $room->setting('speaker_refs', []))
|
||||
->reject(fn (string $ref) => $ref === $participant->user_ref)
|
||||
->values()
|
||||
->all();
|
||||
|
||||
$room->update([
|
||||
'settings' => array_merge($room->settings ?? [], [
|
||||
'speaker_refs' => $speakerRefs,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
return $participant->fresh();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user