@@ -341,9 +341,14 @@ public function deleteMeeting($meeting, $returnURL)
341341 if (null === $ meeting ) {
342342 return false ;
343343 }
344+
344345 $ em = Database::getManager ();
345346 try {
346- $ meeting ->getMeetingInfoGet ()->delete ();
347+ // No need to delete a instant meeting.
348+ if (\Chamilo \PluginBundle \Zoom \API \Meeting::TYPE_INSTANT != $ meeting ->getMeetingInfoGet ()->type ) {
349+ $ meeting ->getMeetingInfoGet ()->delete ();
350+ }
351+
347352 $ em ->remove ($ meeting );
348353 $ em ->flush ();
349354
@@ -925,6 +930,7 @@ public function getStartOrJoinMeetingURL($meeting)
925930 }
926931
927932 if (\Chamilo \PluginBundle \Zoom \API \Meeting::TYPE_INSTANT == $ meeting ->getMeetingInfoGet ()->type ) {
933+
928934 return $ meeting ->getMeetingInfoGet ()->join_url ;
929935 }
930936
@@ -1217,9 +1223,11 @@ private function unregister($meeting, $registrants)
12171223 */
12181224 private function startInstantMeeting ($ topic , $ user = null , $ course = null , $ group = null , $ session = null )
12191225 {
1226+ $ meetingInfoGet = MeetingInfoGet::fromTopicAndType ($ topic , MeetingInfoGet::TYPE_INSTANT );
1227+ $ meetingInfoGet ->settings ->approval_type = MeetingSettings::APPROVAL_TYPE_AUTOMATICALLY_APPROVE ;
12201228 $ meeting = $ this ->createMeetingFromMeeting (
12211229 (new Meeting ())
1222- ->setMeetingInfoGet (MeetingInfoGet:: fromTopicAndType ( $ topic , MeetingInfoGet:: TYPE_INSTANT ) )
1230+ ->setMeetingInfoGet ($ meetingInfoGet )
12231231 ->setUser ($ user )
12241232 ->setGroup ($ group )
12251233 ->setCourse ($ course )
@@ -1240,12 +1248,14 @@ private function startInstantMeeting($topic, $user = null, $course = null, $grou
12401248 private function createMeetingFromMeeting ($ meeting )
12411249 {
12421250 $ currentUser = api_get_user_entity (api_get_user_id ());
1243- //$meeting->getMeetingInfoGet()->host_email = $currentUser->getEmail();
1251+
12441252 $ meeting ->getMeetingInfoGet ()->settings ->contact_email = $ currentUser ->getEmail ();
12451253 $ meeting ->getMeetingInfoGet ()->settings ->contact_name = $ currentUser ->getFullname ();
12461254 $ recording = 'true ' === $ this ->get ('enableCloudRecording ' ) ? 'cloud ' : 'local ' ;
12471255 $ meeting ->getMeetingInfoGet ()->settings ->auto_recording = $ recording ;
12481256 $ meeting ->getMeetingInfoGet ()->settings ->registrants_email_notification = false ;
1257+
1258+ //$meeting->getMeetingInfoGet()->host_email = $currentUser->getEmail();
12491259 //$meeting->getMeetingInfoGet()->settings->alternative_hosts = $currentUser->getEmail();
12501260
12511261 // Send create to Zoom.
0 commit comments