Skip to content

Commit

Permalink
Feature/ccle 9588 invite note on ical (#167)
Browse files Browse the repository at this point in the history
* Add meeting invite note to ICal
  • Loading branch information
jackvanb authored and rlorenzo committed Nov 26, 2020
1 parent 5b91ee3 commit f81b3b6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions classes/webservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,24 @@ public function get_meeting_webinar_info($id, $webinar) {
return $response;
}

/**
* Get the meeting invite note that was sent for a specific meeting from Zoom.
*
* @param int $id The meeting_id of the meeting to retrieve.
* @return stdClass The meeting's invite note.
* @link https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetinginvitation
*/
public function get_meeting_invitation($id) {
$url = 'meetings/' . $id . '/invitation';
$response = null;
try {
$response = $this->_make_call($url);
} catch (moodle_exception $error) {
debugging($error->getMessage());
}
return $response;
}

/**
* Retrieve ended meetings report for a specified user and period. Handles multiple pages.
*
Expand Down
8 changes: 8 additions & 0 deletions exportical.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,20 @@
$event->add_property('dtstart', Bennu::timestamp_to_datetime($zoom->start_time)); // Start time.
$event->add_property('dtend', Bennu::timestamp_to_datetime($zoom->start_time + $zoom->duration)); // End time.

// Get the meeting invite note to add to the description property.
$service = new mod_zoom_webservice();
$response = $service->get_meeting_invitation($zoom->meeting_id);
$meetinginvite = $response->invitation;

// Compute and add description property to event.
$convertedtext = html_to_text($zoom->intro);
$descriptiontext = get_string('calendardescriptionURL', 'mod_zoom', $CFG->wwwroot . '/mod/zoom/view.php?id=' . $cm->id);
if (!empty($convertedtext)) {
$descriptiontext .= get_string('calendardescriptionintro', 'mod_zoom', $convertedtext);
}
if (!empty($meetinginvite)) {
$descriptiontext .= "\n\n" . $meetinginvite;
}
$event->add_property('description', $descriptiontext);

// Start formatting ical.
Expand Down

0 comments on commit f81b3b6

Please sign in to comment.