summary refs log tree commit diff
path: root/src/gateway/opcodes/StreamWatch.ts
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-08-15 17:09:40 +0200
committerRory& <root@rory.gay>2026-08-18 12:16:45 +0200
commit6b673a2837153edf8995ea482f2ef0ad3f69efde (patch)
tree4203871a916b0c7608dfe58587f6f5ecc9ba2f37 /src/gateway/opcodes/StreamWatch.ts
parentFix logout api (diff)
downloadserver-ts-dev/gwsep.tar.xz
Decouple gateway connection state from inner ws object dev/gwsep
Diffstat (limited to 'src/gateway/opcodes/StreamWatch.ts')
-rw-r--r--src/gateway/opcodes/StreamWatch.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gateway/opcodes/StreamWatch.ts b/src/gateway/opcodes/StreamWatch.ts

index f63e4a158..5237e766f 100644 --- a/src/gateway/opcodes/StreamWatch.ts +++ b/src/gateway/opcodes/StreamWatch.ts
@@ -40,7 +40,7 @@ export async function onStreamWatch(this: WebSocket, data: Payload) { try { parsedKey = parseStreamKey(body.stream_key); } catch (e) { - return this.close(4000, "Invalid stream key"); + return this.rawSocket.close(4000, "Invalid stream key"); } const { type, channelId, guildId, userId } = parsedKey; @@ -50,14 +50,14 @@ export async function onStreamWatch(this: WebSocket, data: Payload) { relations: { channel: true }, }); - if (!stream) return this.close(4000, "Invalid stream key"); + if (!stream) return this.rawSocket.close(4000, "Invalid stream key"); - if (type === "guild" && stream.channel.guild_id != guildId) return this.close(4000, "Invalid stream key"); + if (type === "guild" && stream.channel.guild_id != guildId) return this.rawSocket.close(4000, "Invalid stream key"); const regions = Config.get().regions; const guildRegion = regions.available.find((r) => r.endpoint === stream.endpoint); - if (!guildRegion) return this.close(4000, "Unknown region"); + if (!guildRegion) return this.rawSocket.close(4000, "Unknown region"); const streamSession = StreamSession.create({ stream_id: stream.id,