Require acceptance for space speak invites and add instant co-host promotion.
Deploy Ladill Meet / deploy (push) Successful in 40s
Deploy Ladill Meet / deploy (push) Successful in 40s
Remove duplicate host record button on desktop and split invite-to-speak from make co-host so listeners must accept before speaking while co-host is applied immediately. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -72,6 +72,49 @@ class SpaceService
|
||||
], true);
|
||||
}
|
||||
|
||||
public function inviteToSpeak(Room $room, Participant $participant): Participant
|
||||
{
|
||||
abort_unless($room->isSpace(), 422);
|
||||
abort_unless(in_array($participant->role, ['attendee', 'guest', 'participant'], true), 422);
|
||||
abort_unless(! $participant->speak_requested, 422, 'An invitation is already pending.');
|
||||
|
||||
$participant->update([
|
||||
'speak_requested' => true,
|
||||
'hand_raised' => false,
|
||||
]);
|
||||
|
||||
return $participant->fresh();
|
||||
}
|
||||
|
||||
public function acceptSpeakInvitation(Room $room, Participant $participant): Participant
|
||||
{
|
||||
abort_unless($room->isSpace(), 422);
|
||||
abort_unless(in_array($participant->role, ['attendee', 'guest', 'participant'], true), 422);
|
||||
abort_unless($participant->speak_requested, 422, 'No speak invitation to accept.');
|
||||
|
||||
return $this->promoteToSpeaker($room, $participant);
|
||||
}
|
||||
|
||||
public function declineSpeakInvitation(Room $room, Participant $participant): Participant
|
||||
{
|
||||
abort_unless($room->isSpace(), 422);
|
||||
abort_unless($participant->speak_requested, 422);
|
||||
|
||||
$participant->update(['speak_requested' => false]);
|
||||
|
||||
return $participant->fresh();
|
||||
}
|
||||
|
||||
public function dismissSpeakInvitation(Room $room, Participant $participant): Participant
|
||||
{
|
||||
abort_unless($room->isSpace(), 422);
|
||||
abort_unless($participant->speak_requested, 422);
|
||||
|
||||
$participant->update(['speak_requested' => false]);
|
||||
|
||||
return $participant->fresh();
|
||||
}
|
||||
|
||||
public function promoteToSpeaker(Room $room, Participant $participant): Participant
|
||||
{
|
||||
abort_unless($room->isSpace(), 422);
|
||||
@@ -80,6 +123,7 @@ class SpaceService
|
||||
$participant->update([
|
||||
'role' => 'panelist',
|
||||
'hand_raised' => false,
|
||||
'speak_requested' => false,
|
||||
]);
|
||||
|
||||
if ($participant->user_ref) {
|
||||
@@ -99,12 +143,25 @@ class SpaceService
|
||||
return $participant->fresh();
|
||||
}
|
||||
|
||||
public function demoteFromSpeaker(Room $room, Participant $participant): Participant
|
||||
public function promoteToCoHost(Room $room, Participant $participant): Participant
|
||||
{
|
||||
abort_unless($room->isSpace(), 422);
|
||||
abort_unless($participant->role === 'panelist', 422);
|
||||
|
||||
$participant->update(['role' => 'attendee']);
|
||||
$participant->update(['role' => 'co_host']);
|
||||
|
||||
return $participant->fresh();
|
||||
}
|
||||
|
||||
public function demoteFromSpeaker(Room $room, Participant $participant): Participant
|
||||
{
|
||||
abort_unless($room->isSpace(), 422);
|
||||
abort_unless(in_array($participant->role, ['panelist', 'co_host'], true), 422);
|
||||
|
||||
$participant->update([
|
||||
'role' => 'attendee',
|
||||
'speak_requested' => false,
|
||||
]);
|
||||
|
||||
if ($participant->user_ref) {
|
||||
$speakerRefs = collect((array) $room->setting('speaker_refs', []))
|
||||
|
||||
Reference in New Issue
Block a user