summary refs log tree commit diff
path: root/gateway/src/opcodes/Identify.ts
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-08 22:49:16 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-09 23:28:27 +0200
commit26293f37a1f7af131507c0bdd490d2e07f1a9ba7 (patch)
tree3fdaa7b65f1b66069d08d06143a43c9908395a09 /gateway/src/opcodes/Identify.ts
parentClean up BaseClient assign call (diff)
downloadserver-ts-26293f37a1f7af131507c0bdd490d2e07f1a9ba7.tar.xz
Use deep merge everywhere
Diffstat (limited to 'gateway/src/opcodes/Identify.ts')
-rw-r--r--gateway/src/opcodes/Identify.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts

index c6c24fcd..ca081d02 100644 --- a/gateway/src/opcodes/Identify.ts +++ b/gateway/src/opcodes/Identify.ts
@@ -28,6 +28,7 @@ import { IdentifySchema } from "../schema/Identify"; const experiments: any = []; import { check } from "./instanceOf"; import { Recipient } from "@fosscord/util"; +import { OrmUtils } from "@fosscord/util"; // TODO: user sharding // TODO: check privileged intents, if defined in the config @@ -50,7 +51,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { const session_id = genSessionId(); this.session_id = session_id; //Set the session of the WebSocket object - + const [user, read_states, members, recipients, session, application] = await Promise.all([ User.findOneOrFail({ @@ -83,7 +84,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { // TODO: public user selection }), // save the session and delete it when the websocket is closed - Object.assign(new Session(),{ + await OrmUtils.mergeDeep(new Session(), { user_id: this.user_id, session_id: session_id, // TODO: check if status is only one of: online, dnd, offline, idle