summary refs log tree commit diff
path: root/gateway
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-16 00:19:10 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-16 00:19:10 +0200
commitbdebf7d205d92d711e03b58988191ffebaf273bd (patch)
tree784bd7d52e5119ec665c2f86f0135c85a39e664c /gateway
parent:lock: update modules (diff)
downloadserver-bdebf7d205d92d711e03b58988191ffebaf273bd.tar.xz
:bug: fix #450 (only if user is a bot application)
Diffstat (limited to 'gateway')
-rw-r--r--gateway/src/opcodes/Identify.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts
index 2f9d4632..88b514b2 100644
--- a/gateway/src/opcodes/Identify.ts
+++ b/gateway/src/opcodes/Identify.ts
@@ -12,6 +12,7 @@ import {
 	PublicUser,
 	PrivateUserProjection,
 	ReadState,
+	Application,
 } from "@fosscord/util";
 import { Send } from "../util/Send";
 import { CLOSECODES, OPCODES } from "../util/Constants";
@@ -171,6 +172,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
 
 	const d: ReadyEventData = {
 		v: 8,
+		application: await Application.findOne({ id: this.user_id }),
 		user: privateUser,
 		user_settings: user.settings,
 		// @ts-ignore
@@ -213,7 +215,6 @@ export async function onIdentify(this: WebSocket, data: Payload) {
 		users: users.filter((x) => x).unique(),
 		merged_members: merged_members,
 		// shard // TODO: only for bots sharding
-		// application // TODO for applications
 	};
 
 	// TODO: send real proper data structure