Skip to content

Commit

Permalink
VC/Zoom: s/rooms/meetings/ (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiefMaster authored Dec 11, 2024
1 parent 84f2155 commit 02e0699
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 35 deletions.
8 changes: 6 additions & 2 deletions vc_zoom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

## Changelog

### 3.3.2

- Stop using the (incorrect) "room" terminology for Zoom meetings, and call them "meetings" instead

### 3.3.1

- Adapt to Indico 3.3.5 changes
Expand Down Expand Up @@ -96,7 +100,7 @@

- Improve logging when a Zoom API request fails
- Fail more gracefully if no Zoom account could be found for a user
- Allow using the same name for multiple Zoom rooms
- Allow using the same name for multiple Zoom meetings
- Update the join url when changing the passcode
- Provide an alternative method of looking up the Zoom user corresponding to an Indico user
- Always show the full join link and passcode to event managers
Expand All @@ -107,7 +111,7 @@
- Show detailed error when deleting a meeting fails
- Do not allow passcodes that are too long for zoom
- Remove the "Assistant Zoom ID" logic due to problems with Zoom's API rate limits (all meetings created were counted against the assistant's rate limit instead of the host's); this means the host can no longer be changed, but Indico instead provides an option to event managers to make themselves a co-host.
- Fix an error when changing the linked object of a recurring Zoom room in Indico
- Fix an error when changing the linked object of a recurring Zoom meeting in Indico
- Include Zoom join links in the event's ical export (note: only Zoom meetings with a public passcode are displayed unless you have at least Indico v2.3.3)
- Skip deleted Zoom meetings when cloning events
- Mark Zoom meetings as deleted when receiving the corresponding webhook event
Expand Down
4 changes: 2 additions & 2 deletions vc_zoom/indico_vc_zoom/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def cli():

@cli.command()
@click.option('--status', type=click.Choice(['deleted', 'created']))
def rooms(status=None):
"""Lists all Zoom rooms"""
def meetings(status=None):
"""Lists all Zoom meetings"""

room_query = VCRoom.query.filter_by(type='zoom')
table_data = [['ID', 'Name', 'Status', 'Zoom ID']]
Expand Down
4 changes: 2 additions & 2 deletions vc_zoom/indico_vc_zoom/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ def _handle_zoom_event(self, event, payload):

if not vc_room:
# This usually happens when a room wasn't created via indico
current_plugin.logger.debug('Action for unhandled Zoom room: %s', meeting_id)
current_plugin.logger.debug('Action for unhandled Zoom meeting: %s', meeting_id)
return

if event in ('meeting.updated', 'webinar.updated'):
current_plugin.refresh_room(vc_room, None)
elif event in ('meeting.deleted', 'webinar.deleted'):
current_plugin.logger.info('Zoom room deleted: %s', meeting_id)
current_plugin.logger.info('Zoom meeting deleted: %s', meeting_id)
vc_room.status = VCRoomStatus.deleted
else:
current_plugin.logger.warning('Unhandled Zoom webhook payload: %s', event)
2 changes: 1 addition & 1 deletion vc_zoom/indico_vc_zoom/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@pytest.fixture
def zoom_plugin(app):
"""Return a callable which lets you create dummy Zoom room occurrences."""
"""Return a callable which lets you create dummy Zoom meeting occurrences."""
from indico_vc_zoom.plugin import ZoomPlugin

plugin = ZoomPlugin(plugin_engine, app)
Expand Down
8 changes: 4 additions & 4 deletions vc_zoom/indico_vc_zoom/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,21 @@ class VCRoomForm(VCRoomFormBase):

mute_audio = BooleanField(_('Mute audio'),
widget=SwitchWidget(),
description=_('Participants will join the VC room muted by default '))
description=_('Participants will join the meeting muted by default '))

mute_host_video = BooleanField(_('Mute video (host)'),
widget=SwitchWidget(),
description=_('The host will join the VC room with video disabled'))
description=_('The host will join the meeting with video disabled'))

mute_participant_video = BooleanField(_('Mute video (participants)'),
widget=SwitchWidget(),
description=_('Participants will join the VC room with video disabled'))
description=_('Participants will join the meeting with video disabled'))

waiting_room = BooleanField(_('Waiting room'),
widget=SwitchWidget(),
description=_('Participants may be kept in a waiting room by the host'))

description = TextAreaField(_('Description'), description=_('Optional description for this room'))
description = TextAreaField(_('Description'), description=_('Optional description for this meeting'))

def __init__(self, *args, **kwargs):
defaults = kwargs['obj']
Expand Down
35 changes: 18 additions & 17 deletions vc_zoom/indico_vc_zoom/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ class PluginSettingsForm(VCPluginSettingsFormBase):

mute_audio = BooleanField(_('Mute audio'),
widget=SwitchWidget(),
description=_('Participants will join the VC room muted by default '))
description=_('Participants will join the meeting muted by default '))

mute_host_video = BooleanField(_('Mute video (host)'),
widget=SwitchWidget(),
description=_('The host will join the VC room with video disabled'))
description=_('The host will join the meeting with video disabled'))

mute_participant_video = BooleanField(_('Mute video (participants)'),
widget=SwitchWidget(),
description=_('Participants will join the VC room with video disabled'))
description=_('Participants will join the meeting with video disabled'))

join_before_host = BooleanField(_('Join Before Host'),
widget=SwitchWidget(),
Expand All @@ -108,7 +108,8 @@ class PluginSettingsForm(VCPluginSettingsFormBase):
description=_('Participants may be kept in a waiting room by the host'))

creation_email_footer = TextAreaField(_('Creation email footer'), widget=TinyMCEWidget(),
description=_('Footer to append to emails sent upon creation of a VC room'))
description=_('Footer to append to emails sent upon creation of a Zoom '
'meeting'))

send_host_url = BooleanField(_('Send host URL'),
widget=SwitchWidget(),
Expand Down Expand Up @@ -230,8 +231,8 @@ def update_data_association(self, event, vc_room, room_assoc, data):
self.refresh_room(vc_room, event)
if vc_room.data.get('registration_required'):
raise UserValueError(
_('The room "{}" is using Zoom registration and thus cannot be attached to another event')
.format(vc_room.name)
_('The meeting "{}" is using Zoom registration and thus cannot be attached to another '
'event').format(vc_room.name)
)
# this means we are updating an existing meeting with a new vc_room-event association
update_zoom_meeting(vc_room.data['zoom_id'], {
Expand Down Expand Up @@ -298,14 +299,14 @@ def update_data_vc_room(self, vc_room, data, is_new=False):
flag_modified(vc_room, 'data')

def create_room(self, vc_room, event):
"""Create a new Zoom room for an event, given a VC room.
"""Create a new Zoom meeting for an event, given a VC room.
In order to create the Zoom room, the function will try to get
In order to create the Zoom meeting, the function will try to get
a valid e-mail address for the user in question, which can be
use with the Zoom API.
:param vc_room: the VC room from which to create the Zoom room
:param event: the event to the Zoom room will be attached
:param vc_room: the VC room from which to create the Zoom meeting
:param event: the event to the Zoom meeting will be attached
"""
client = ZoomIndicoClient()
host = principal_from_identifier(vc_room.data['host'])
Expand Down Expand Up @@ -357,8 +358,8 @@ def create_room(self, vc_room, event):
else:
meeting_obj = client.create_meeting(host_email, **kwargs)
except HTTPError as e:
self.logger.exception('Error creating Zoom Room: %s', e.response.content)
raise VCRoomError(_('Could not create the room in Zoom. Please contact support if the error persists'))
self.logger.exception('Error creating Zoom meeting: %s', e.response.content)
raise VCRoomError(_('Could not create the meeting in Zoom. Please contact support if the error persists'))

vc_room.data.update({
'zoom_id': str(meeting_obj['id']),
Expand Down Expand Up @@ -445,13 +446,13 @@ def delete_room(self, vc_room, event):
# if there's a 404, there is no problem, since the room is supposed to be gone anyway
if e.response.status_code == 404:
if has_request_context():
flash(_("Room didn't exist in Zoom anymore"), 'warning')
flash(_("Meeting didn't exist in Zoom anymore"), 'warning')
elif e.response.status_code == 400:
# some sort of operational error on Zoom's side, deserves a specific error message
raise VCRoomError(_('Zoom Error: "{}"').format(e.response.json()['message']))
else:
self.logger.error("Can't delete room")
raise VCRoomError(_('Problem deleting room'))
self.logger.error("Can't delete meeting")
raise VCRoomError(_('Problem deleting Zoom meeting'))

def clone_room(self, old_event_vc_room, link_object):
vc_room = old_event_vc_room.vc_room
Expand All @@ -473,13 +474,13 @@ def clone_room(self, old_event_vc_room, link_object):
# mark room as deleted
vc_room.status = VCRoomStatus.deleted
flash(
_('The room "{}" no longer exists in Zoom and was removed from the event').format(vc_room.name),
_('The meeting "{}" no longer exists in Zoom and was removed from the event').format(vc_room.name),
'warning'
)
return None

if vc_room.data.get('registration_required'):
flash(_('The room "{}" is using Zoom registration and thus cannot be attached to the new event')
flash(_('The meeting "{}" is using Zoom registration and thus cannot be attached to the new event')
.format(vc_room.name), 'warning')
return None

Expand Down
4 changes: 2 additions & 2 deletions vc_zoom/indico_vc_zoom/templates/emails/remote_deleted.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

{% block header -%}
<p>
The Zoom room "{{ vc_room.name }}" has been deleted from the Zoom server since it has not been used by any recent event.
The Zoom meeting "{{ vc_room.name }}" has been deleted from the Zoom server since it has not been used by any recent event.
</p>
<p>
You won't be able to attach it to any future events. If you need to do so, please create a new room.
You won't be able to attach it to any future events. If you need to do so, please create a new meeting.
</p>
{% block custom_footer %}{% endblock %}

Expand Down
8 changes: 4 additions & 4 deletions vc_zoom/indico_vc_zoom/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ def fetch_zoom_meeting(vc_room, client=None, is_webinar=False):
except HTTPError as e:
if e.response.status_code in {400, 404}:
# Indico will automatically mark this room as deleted
raise VCRoomNotFoundError(_('This room has been deleted from Zoom'))
raise VCRoomNotFoundError(_('This meeting has been deleted from Zoom'))
else:
from indico_vc_zoom.plugin import ZoomPlugin
ZoomPlugin.logger.exception('Error getting Zoom Room: %s', e.response.content)
raise VCRoomError(_('Problem fetching room from Zoom. Please contact support if the error persists.'))
ZoomPlugin.logger.exception('Error getting Zoom meeting: %s', e.response.content)
raise VCRoomError(_('Problem fetching meeting from Zoom. Please contact support if the error persists.'))


def update_zoom_meeting(zoom_id, changes, is_webinar=False):
Expand All @@ -149,7 +149,7 @@ def update_zoom_meeting(zoom_id, changes, is_webinar=False):

if e.response.json()['code'] == 3001:
# "Meeting does not exist"
raise VCRoomNotFoundError(_('Room no longer exists in Zoom'))
raise VCRoomNotFoundError(_('Meeting no longer exists in Zoom'))

raise VCRoomError(_("Can't update meeting. Please contact support if the error persists."))

Expand Down
2 changes: 1 addition & 1 deletion vc_zoom/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = 'indico-plugin-vc-zoom'
description = 'Zoom video-conferencing plugin for Indico'
readme = 'README.md'
version = '3.3.1'
version = '3.3.2'
license = 'MIT'
authors = [
{ name = 'Indico Team', email = '[email protected]' },
Expand Down

0 comments on commit 02e0699

Please sign in to comment.