mirror of
https://github.com/Yonle/bostr.git
synced 2025-10-06 22:12:54 +02:00
bouncer: rehandling on forwarding ws.my_events
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
@@ -78,15 +78,15 @@ module.exports = (ws, req, onClose) => {
|
|||||||
return ws.send(JSON.stringify(["OK", data[1]?.id, false, "rate-limited: request too fast."]));
|
return ws.send(JSON.stringify(["OK", data[1]?.id, false, "rate-limited: request too fast."]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastEvent = Date.now();
|
||||||
|
ws.my_events.add(data[1]);
|
||||||
|
|
||||||
if (!ws.relays.size && !sessStarted) {
|
if (!ws.relays.size && !sessStarted) {
|
||||||
console.log(process.pid, `>>>`, `${ws.ip} executed ${data[0]} command for the first. Initializing session`);
|
console.log(process.pid, `>>>`, `${ws.ip} executed ${data[0]} command for the first. Initializing session`);
|
||||||
newsess(ws);
|
newsess(ws);
|
||||||
sessStarted = true;
|
sessStarted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastEvent = Date.now();
|
|
||||||
|
|
||||||
ws.my_events.add(data[1]);
|
|
||||||
bc(data, ws);
|
bc(data, ws);
|
||||||
ws.send(JSON.stringify(["OK", data[1]?.id, true, ""]));
|
ws.send(JSON.stringify(["OK", data[1]?.id, true, ""]));
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user