summary refs log tree commit diff
path: root/gateway
diff options
context:
space:
mode:
Diffstat (limited to 'gateway')
-rw-r--r--gateway/src/listener/listener.ts2
-rw-r--r--gateway/src/opcodes/Identify.ts2
-rw-r--r--gateway/src/opcodes/LazyRequest.ts1
3 files changed, 3 insertions, 2 deletions
diff --git a/gateway/src/listener/listener.ts b/gateway/src/listener/listener.ts
index 75ca1680..67837e8d 100644
--- a/gateway/src/listener/listener.ts
+++ b/gateway/src/listener/listener.ts
@@ -26,7 +26,7 @@ import { Recipient } from "../../../util/dist/entities/Recipient";
 
 // TODO: use already queried guilds/channels of Identify and don't fetch them again
 export async function setupListener(this: WebSocket) {
-	const members = await Member.find({ where: { id: this.user_id } });
+	const members = await Member.find({ user_id: this.user_id });
 	const guild_ids = members.map((x) => x.guild_id);
 	const user = await User.findOneOrFail({ id: this.user_id });
 	const recipients = await Recipient.find({ where: { id: this.user_id }, relations: ["channel"] });
diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts
index 958f1b73..4a1b7a45 100644
--- a/gateway/src/opcodes/Identify.ts
+++ b/gateway/src/opcodes/Identify.ts
@@ -56,7 +56,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
 	}
 
 	const members = await Member.find({
-		where: { id: this.user_id },
+		where: { user_id: this.user_id },
 		relations: ["guild", "guild.channels", "guild.emojis", "guild.roles", "guild.stickers", "user", "roles"],
 	});
 	const merged_members = members.map((x: any) => {
diff --git a/gateway/src/opcodes/LazyRequest.ts b/gateway/src/opcodes/LazyRequest.ts
index 9f514f5f..146175b5 100644
--- a/gateway/src/opcodes/LazyRequest.ts
+++ b/gateway/src/opcodes/LazyRequest.ts
@@ -8,6 +8,7 @@ import { check } from "./instanceOf";
 
 // TODO: check permission and only show roles/members that have access to this channel
 // TODO: config: if want to list all members (even those who are offline) sorted by role, or just those who are online
+// TODO: rewrite typeorm
 
 export async function onLazyRequest(this: WebSocket, { d }: Payload) {
 	// TODO: check data