Merge branch 'MDL-75894-master' of https://github.com/jleyva/moodle

This commit is contained in:
Jun Pataleta 2022-10-20 14:40:22 +08:00
commit d98380b272
4 changed files with 32 additions and 1 deletions

View File

@ -97,7 +97,13 @@ class meeting_info extends external_api {
bigbluebutton_proxy::get_server_not_available_url($instance),
bigbluebutton_proxy::get_server_not_available_message($instance));
}
return (array) meeting::get_meeting_info_for_instance($instance, $updatecache);
$meetinginfo = (array) meeting::get_meeting_info_for_instance($instance, $updatecache);
// Make the structure WS friendly.
array_walk($meetinginfo['features'], function(&$value, $key){
$value = ['name' => $key, 'isenabled' => (bool) $value];
});
return $meetinginfo;
}
/**
@ -134,6 +140,12 @@ class meeting_info extends external_api {
])
),
'joinurl' => new external_value(PARAM_URL, 'Join URL'),
'features' => new \external_multiple_structure(
new external_single_structure([
'name' => new external_value(PARAM_ALPHA, 'Feature name.'),
'isenabled' => new external_value(PARAM_BOOL, 'Whether the feature is enabled.'),
]), 'List of features for the instance', VALUE_OPTIONAL
),
]
);
}

View File

@ -281,6 +281,9 @@ class meeting {
$meetinginfo->attendees[] = (array) $attendee;
}
}
$meetinginfo->features = $instance->get_enabled_features();
return $meetinginfo;
}

View File

@ -155,6 +155,17 @@ class meeting_test extends \advanced_testcase {
$meeting->update_cache();
$meetinginfo = $meeting->get_meeting_info();
$this->assertFalse($meetinginfo->statusrunning);
if ($type == instance::TYPE_ALL) {
$this->assertTrue($meetinginfo->features['showroom']);
$this->assertTrue($meetinginfo->features['showrecordings']);
} else if ($type == instance::TYPE_ROOM_ONLY) {
$this->assertTrue($meetinginfo->features['showroom']);
$this->assertFalse($meetinginfo->features['showrecordings']);
} else if ($type == instance::TYPE_RECORDING_ONLY) {
$this->assertFalse($meetinginfo->features['showroom']);
$this->assertTrue($meetinginfo->features['showrecordings']);
}
}
/**

View File

@ -0,0 +1,5 @@
This files describes API changes in the bigbluebuttonbn code.
=== 4.1 ===
* External function mod_bigbluebuttonbn\external\meeting_info now return the list of the instance features and whether they are
enabled or not.