mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 05:05:53 +00:00
Distinguish between an unknown meeting, and an meeting that's ended
This commit is contained in:
parent
5c4927cd37
commit
a06e002c28
@ -265,19 +265,27 @@ export class DimensionBigBlueButtonService {
|
||||
@QueryParam("meetingId") meetingId: string,
|
||||
@QueryParam("meetingPassword") password: string,
|
||||
): Promise<BigBlueButtonCreateAndJoinMeetingResponse|ApiError> {
|
||||
// Check if the meeting is actually running. If not, return an error
|
||||
let isMeetingRunningParameters = {
|
||||
// Check if the meeting exists and is running. If not, return an error for each case
|
||||
let getMeetingInfoParameters = {
|
||||
meetingID: meetingId,
|
||||
}
|
||||
|
||||
const isMeetingRunningResponse = await this.makeBBBApiCall("GET", "isMeetingRunning", isMeetingRunningParameters, null);
|
||||
if (isMeetingRunningResponse.running[0].toLowerCase() !== "true") {
|
||||
// This meeting is not running, inform the user
|
||||
const getMeetingInfoResponse = await this.makeBBBApiCall("GET", "getMeetingInfo", getMeetingInfoParameters, null);
|
||||
LogService.info("BigBlueButton", getMeetingInfoResponse)
|
||||
if (getMeetingInfoResponse.returncode[0] === "FAILED") {
|
||||
// This meeting does not exist, inform the user
|
||||
return new ApiError(
|
||||
400,
|
||||
{error: "This meeting does not exist or has ended."},
|
||||
{error: "This meeting does not exist."},
|
||||
"UNKNOWN_MEETING_ID",
|
||||
);
|
||||
} else if (getMeetingInfoResponse.running[0] === "false" && getMeetingInfoResponse.endTime[0] !== "0") {
|
||||
// This meeting did exist, but has ended. Inform the user
|
||||
return new ApiError(
|
||||
400,
|
||||
{error: "This meeting has ended."},
|
||||
"MEETING_HAS_ENDED",
|
||||
);
|
||||
}
|
||||
|
||||
let joinQueryParameters = {
|
||||
|
@ -152,12 +152,18 @@ export class BigBlueButtonWidgetWrapperComponent extends CapableWidget implement
|
||||
if ("errorCode" in response) {
|
||||
// This is an instance of ApiError
|
||||
if (response.errorCode === "UNKNOWN_MEETING_ID") {
|
||||
// It's likely that everyone has left the meeting, and it's been garbage collected.
|
||||
// This meeting ID is invalid.
|
||||
// Inform the user that they should try and start a new meeting
|
||||
this.statusMessage = "This meeting has ended or otherwise does not exist.<br>Please start a new meeting.";
|
||||
return;
|
||||
}
|
||||
|
||||
if (response.errorCode === "MEETING_HAS_ENDED") {
|
||||
// It's likely that everyone has left the meeting, and it's been garbage collected.
|
||||
// Inform the user that they should try and start a new meeting
|
||||
this.statusMessage = "This meeting has ended.<br>Please start a new meeting.";
|
||||
return;
|
||||
}
|
||||
// Otherwise this is a generic error
|
||||
this.statusMessage = "An error occurred while loading the meeting";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user