diff options
Diffstat (limited to 'webrtc/src/opcodes/Resume.ts')
-rw-r--r-- | webrtc/src/opcodes/Resume.ts | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/webrtc/src/opcodes/Resume.ts b/webrtc/src/opcodes/Resume.ts deleted file mode 100644 index 856b550c..00000000 --- a/webrtc/src/opcodes/Resume.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { CLOSECODES, WebSocket } from "@fosscord/gateway"; -import { Payload } from "./index"; -import { Server } from "../Server" -import { Guild, Session, VoiceOPCodes } from "@fosscord/util"; - -export async function onResume(this: Server, socket: WebSocket, data: Payload) { - const session = await Session.findOneOrFail( - { session_id: data.d.session_id, }, - { - where: { user_id: data.d.user_id }, - relations: ["user"] - } - ); - const user = session.user; - const guild = await Guild.findOneOrFail({ id: data.d.server_id }, { relations: ["members"] }); - - if (!guild.members.find(x => x.id === user.id)) - return socket.close(CLOSECODES.Invalid_intent); - - socket.send(JSON.stringify({ - op: VoiceOPCodes.RESUMED, - d: null, - })) -} \ No newline at end of file |