ensure that channel is being looked up with reservation_no
This commit is contained in:
parent
66b8ef945f
commit
8ee1c6551f
@ -30,16 +30,16 @@ class XhrListener {
|
||||
}
|
||||
|
||||
public relayEvent(event: string, archMsg: ArchimedesMessage): boolean {
|
||||
logger.debugLog.info(`XhrListener:relayEvent(event: ${event}, channel: ${archMsg.examId})`);
|
||||
logger.debugLog.info(`XhrListener:relayEvent(event: ${event}, channel: ${archMsg.reservation_no})`);
|
||||
for (let c of this.#cm.channels) {
|
||||
if (archMsg.examId === c.id) {
|
||||
if (archMsg.reservation_no === c.id) {
|
||||
let dmCount: number = 0;
|
||||
for (let client of c.clients) {
|
||||
let nonce: string = crypto.randomBytes(4).toString("hex");
|
||||
// TODO: verify the nonce against the received reply, which we currently ignore
|
||||
client.directMessage(JSON.stringify({
|
||||
message_type: "broadcast",
|
||||
message: { event_type: event, seq_id: nonce, reservation_no: archMsg.reservation_no }
|
||||
message: { event_type: event, seq_id: nonce, examId: archMsg.examId }
|
||||
}));
|
||||
dmCount++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user