fix: endWhenNoModerator* passed meetingCreate params should override default values

This commit is contained in:
Anton Georgiev 2021-06-03 19:46:57 +00:00
parent 74ac0f8e01
commit 06b73419a6
2 changed files with 12 additions and 2 deletions

View File

@ -81,6 +81,7 @@ public class ApiParams {
// Needed for classes where teacher gets disconnected and can't get back in. Prevents
// students from running amok.
public static final String END_WHEN_NO_MODERATOR = "endWhenNoModerator";
public static final String END_WHEN_NO_MODERATOR_DELAY_IN_MINUTES = "endWhenNoModeratorDelayInMinutes";
private ApiParams() {
throw new IllegalStateException("ApiParams is a utility class. Instanciation is forbidden.");

View File

@ -440,6 +440,15 @@ public class ParamsProcessorUtil {
}
}
int endWhenNoModeratorDelayInMinutes = defaultEndWhenNoModeratorDelayInMinutes;
if (!StringUtils.isEmpty(params.get(ApiParams.END_WHEN_NO_MODERATOR_DELAY_IN_MINUTES))) {
try {
endWhenNoModeratorDelayInMinutes = Integer.parseInt(params.get(ApiParams.END_WHEN_NO_MODERATOR_DELAY_IN_MINUTES));
} catch (Exception ex) {
log.warn("Invalid param [endWhenNoModeratorDelayInMinutes] for meeting=[{}]", internalMeetingId);
}
}
String guestPolicy = defaultGuestPolicy;
if (!StringUtils.isEmpty(params.get(ApiParams.GUEST_POLICY))) {
guestPolicy = params.get(ApiParams.GUEST_POLICY);
@ -524,8 +533,8 @@ public class ParamsProcessorUtil {
meeting.setUserActivitySignResponseDelayInMinutes(userActivitySignResponseDelayInMinutes);
meeting.setUserInactivityThresholdInMinutes(userInactivityThresholdInMinutes);
// meeting.setHtml5InstanceId(html5InstanceId);
meeting.setEndWhenNoModerator(defaultEndWhenNoModerator);
meeting.setEndWhenNoModeratorDelayInMinutes(defaultEndWhenNoModeratorDelayInMinutes);
meeting.setEndWhenNoModerator(endWhenNoModerator);
meeting.setEndWhenNoModeratorDelayInMinutes(endWhenNoModeratorDelayInMinutes);
// Add extra parameters for breakout room
if (isBreakout) {