From b91e633a7048c94a822dacde0732009ae6a8543c Mon Sep 17 00:00:00 2001 From: reivilibre Date: Fri, 23 Feb 2024 16:52:53 +0000 Subject: [PATCH] Update auditorium names to be the track name on talk start (#230) * Update auditorium names to be the track name on talk start * Update src/Scheduler.ts Co-authored-by: Will Hunt * Test talk track is not empty before pulling state --------- Co-authored-by: Will Hunt --- src/Scheduler.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Scheduler.ts b/src/Scheduler.ts index 4f82c01..20d9b61 100644 --- a/src/Scheduler.ts +++ b/src/Scheduler.ts @@ -379,6 +379,18 @@ export class Scheduler { (task.talk.qa_startTime !== null ? `

During the talk, you can ask questions here for the Q&A at the end. ` + `The questions with the most 👍 votes are most visible to the speaker.

` : ''), ); + + try { + if (task.talk.track != '' && task.talk.track != undefined) { + const nameEventContent = await this.client.getRoomStateEvent(confAud.roomId, "m.room.name", ""); + if (task.talk.track != nameEventContent["name"]) { + nameEventContent["name"] = task.talk.track; + await this.client.sendStateEvent(confAud.roomId, "m.room.name", "", nameEventContent); + } + } + } catch (e) { + LogService.error("Scheduler:talkStart", `Error when considering changing name of track room`, e); + } } else if (task.type === ScheduledTaskType.TalkQA) { if (!task.talk.prerecorded) return; if (confTalk !== undefined) {