Skip to content

Commit 70b4b73

Browse files
committed
Introduce IsMeetingExisting-function
1 parent 5b97c82 commit 70b4b73

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/BigBlueButton.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,26 @@ public function isMeetingRunning(IsMeetingRunningParameters $meetingParams): IsM
208208
return new IsMeetingRunningResponse($xml);
209209
}
210210

211+
/**
212+
* Checks weather a meeting is existing.
213+
*
214+
* @see https://github.com/bigbluebutton/bigbluebutton/issues/8246
215+
*
216+
* @throws BadResponseException
217+
*/
218+
public function isMeetingExisting(string $meetingId): bool
219+
{
220+
$meetings = $this->getMeetings()->getMeetings();
221+
222+
foreach ($meetings as $meeting) {
223+
if ($meetingId === $meeting->getMeetingId()) {
224+
return true;
225+
}
226+
}
227+
228+
return false;
229+
}
230+
211231
public function getMeetingsUrl(): string
212232
{
213233
return $this->urlBuilder->buildUrl(ApiMethod::GET_MEETINGS);
@@ -505,7 +525,9 @@ private function sendRequest(string $url, string $payload = '', string $contentT
505525
*/
506526
private function processXmlResponse(string $url, string $payload = '', string $contentType = 'application/xml'): \SimpleXMLElement
507527
{
508-
return new \SimpleXMLElement($this->sendRequest($url, $payload, $contentType));
528+
$response = $this->sendRequest($url, $payload, $contentType);
529+
530+
return new \SimpleXMLElement($response);
509531
}
510532

511533
/**

0 commit comments

Comments
 (0)