mirror of
https://github.com/spacebarchat/server.git
synced 2026-08-22 05:29:59 +00:00
Close: use session as predicate rather than session_id due to early init
This commit is contained in:
@@ -30,7 +30,7 @@ export async function Close(this: WebSocket, code: number, reason: Buffer) {
|
||||
this.inflate?.close();
|
||||
this.removeAllListeners();
|
||||
|
||||
if (this.session_id) {
|
||||
if (this.session) {
|
||||
const authSessionId = this.session?.session_id;
|
||||
const closedAt = Date.now();
|
||||
|
||||
@@ -66,6 +66,7 @@ export async function Close(this: WebSocket, code: number, reason: Buffer) {
|
||||
}
|
||||
}, 10_000);
|
||||
|
||||
if (!this.user_id) console.error("No user id in websocket???", this);
|
||||
const voiceState = await VoiceState.findOne({
|
||||
where: { user_id: this.user_id },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user