You are here

function zoomapi_meeting_join in Zoom API 7

Join Meeting.

Parameters

array $meeting: The meeting array returned from the create meeting functions.

File

./zoomapi.module, line 404
Main file for the Zoom API module.

Code

function zoomapi_meeting_join(array $meeting) {
  global $user;

  // Ensure we have the latest account information in case the zoomapi_user_id
  // was recently created.
  $account = user_load($user->uid);
  if (!empty($account->data['zoomapi_user_id']) && $account->data['zoomapi_user_id'] == $meeting['host_id']) {
    $url = $meeting['start_url'];
  }
  else {
    $url = $meeting['join_url'];
  }
  watchdog(__FUNCTION__, 'User @name (uid: !uid) joined meeting "@topic" (id: !meeting_id).', [
    '@name' => $account->name,
    '!uid' => $account->uid,
    '@topic' => $meeting['topic'],
    '!meeting_id' => $meeting['id'],
  ], WATCHDOG_INFO);
  drupal_goto($url, [
    'external' => TRUE,
  ]);
}