From dce66cc033528ddf596500c173122fe25e056f25 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Sat, 4 Feb 2023 16:35:17 +0000 Subject: [PATCH] Prevent log spam by ignored events in physical talk rooms --- src/Scheduler.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Scheduler.ts b/src/Scheduler.ts index e53e8b0..7fb7374 100644 --- a/src/Scheduler.ts +++ b/src/Scheduler.ts @@ -401,7 +401,8 @@ export class Scheduler { } else { await this.client.sendHtmlText(confAud.roomId, `

The talk will end shortly

`); } - } else if (task.type === ScheduledTaskType.TalkStart1H && confTalk !== undefined) { + } else if (task.type === ScheduledTaskType.TalkStart1H) { + if (confTalk === undefined) return; // This stage is skipped entirely for physical auditoriums' talks, because it only serves to nag // TODO Do we need to ensure that coordinators have checked in? @@ -445,11 +446,13 @@ export class Scheduler { await this.client.sendHtmlText(confTalk.roomId, `

Your talk ends in about 5 minutes

The next talk will start automatically after yours.

`); } await this.client.sendHtmlText(confAud.roomId, `

This talk ends in about 5 minutes

` + (task.talk.qa_startTime !== null ? `

Ask questions here for the speakers!

`: '')); - } else if (task.type === ScheduledTaskType.TalkLivestreamEnd1M && confTalk !== undefined) { + } else if (task.type === ScheduledTaskType.TalkLivestreamEnd1M) { + if (confTalk === undefined) return; await this.client.sendHtmlText(confTalk.roomId, `

Your talk ends in about 1 minute!

The next talk will start automatically after yours. Wrap it up!

`); } else if (task.type === ScheduledTaskType.TalkEnd1M) { await this.client.sendHtmlText(confAud.roomId, `

This talk ends in about 1 minute!

`); - } else if (task.type === ScheduledTaskType.TalkCheckin45M && confTalk !== undefined) { + } else if (task.type === ScheduledTaskType.TalkCheckin45M) { + if (confTalk === undefined) return; // TODO This is skipped entirely for physical talks, but do we want to ensure coordinators are checked-in? if (!task.talk.prerecorded) return; @@ -486,7 +489,8 @@ export class Scheduler { const resolved = (await resolveIdentifiers(this.client, userIds)).filter(p => p.mxid).map(p => p.mxid!); await this.checkins.expectCheckinFrom(resolved); } - } else if (task.type === ScheduledTaskType.TalkCheckin30M && confTalk !== undefined) { + } else if (task.type === ScheduledTaskType.TalkCheckin30M) { + if (confTalk === undefined) return; // TODO This is skipped entirely for physical talks, but do we want to ensure coordinators are checked-in? if (!task.talk.prerecorded) return; @@ -523,7 +527,8 @@ export class Scheduler { const resolved = (await resolveIdentifiers(this.client, userIds)).filter(p => p.mxid).map(p => p.mxid!); await this.checkins.expectCheckinFrom(resolved); } // else no complaints - } else if (task.type === ScheduledTaskType.TalkCheckin15M && confTalk !== undefined) { + } else if (task.type === ScheduledTaskType.TalkCheckin15M) { + if (confTalk === undefined) return; // TODO This is skipped entirely for physical talks, but do we want to ensure coordinators are checked-in? if (!task.talk.prerecorded) return;