Skip to content

Commit

Permalink
Prevent log spam by ignored events in physical talk rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre committed Feb 1, 2024
1 parent c3487e5 commit dce66cc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ export class Scheduler {
} else {
await this.client.sendHtmlText(confAud.roomId, `<h3>The talk will end shortly</h3>`);
}
} 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?

Expand Down Expand Up @@ -445,11 +446,13 @@ export class Scheduler {
await this.client.sendHtmlText(confTalk.roomId, `<h3>Your talk ends in about 5 minutes</h3><p>The next talk will start automatically after yours.</p>`);
}
await this.client.sendHtmlText(confAud.roomId, `<h3>This talk ends in about 5 minutes</h3>` + (task.talk.qa_startTime !== null ? `<p>Ask questions here for the speakers!</p>`: ''));
} else if (task.type === ScheduledTaskType.TalkLivestreamEnd1M && confTalk !== undefined) {
} else if (task.type === ScheduledTaskType.TalkLivestreamEnd1M) {
if (confTalk === undefined) return;
await this.client.sendHtmlText(confTalk.roomId, `<h3>Your talk ends in about 1 minute!</h3><p>The next talk will start automatically after yours. Wrap it up!</p>`);
} else if (task.type === ScheduledTaskType.TalkEnd1M) {
await this.client.sendHtmlText(confAud.roomId, `<h3>This talk ends in about 1 minute!</h3>`);
} 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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit dce66cc

Please sign in to comment.