Skip to content

Commit

Permalink
webservice: add moodle filter adaption to meeting topic and description
Browse files Browse the repository at this point in the history
  • Loading branch information
karenliulll committed Aug 27, 2024
1 parent 6598de0 commit 7fc098f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions classes/webservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,15 +590,24 @@ public function get_schedule_for_users($identifier) {
private function database_to_api($zoom) {
global $CFG;

[$course, $cm] = get_course_and_cm_from_instance($zoom, 'zoom');
$context = \context_module::instance($cm->id);

$data = [
'topic' => $zoom->name,
// Process the meeting topic with proper filter.
'topic' => format_text($zoom->name, FORMAT_MOODLE, ['context' => $context, 'para' => false]),
'settings' => [
'host_video' => (bool) ($zoom->option_host_video),
'audio' => $zoom->option_audio,
],
];
if (isset($zoom->intro)) {
$data['agenda'] = content_to_text($zoom->intro, FORMAT_MOODLE);
// Process the description text with proper filter and then convert to plain text.
$data['agenda'] = content_to_text(format_text(
$zoom->intro,
FORMAT_MOODLE,
['context' => $context]
), false);
}

if (isset($CFG->timezone) && !empty($CFG->timezone)) {
Expand Down

0 comments on commit 7fc098f

Please sign in to comment.