diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-02 19:50:05 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-02 19:50:05 +0200 |
commit | d29ccaf623910eea90852fa28cd8ec191bd7afff (patch) | |
tree | 040af2cced2548560403efb72be4d026f41908f9 /gateway | |
parent | :art: update openapi title (diff) | |
download | server-d29ccaf623910eea90852fa28cd8ec191bd7afff.tar.xz |
:sparkles: add user_id field to Member
Diffstat (limited to 'gateway')
-rw-r--r-- | gateway/src/listener/listener.ts | 2 | ||||
-rw-r--r-- | gateway/src/opcodes/Identify.ts | 2 | ||||
-rw-r--r-- | gateway/src/opcodes/LazyRequest.ts | 1 |
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 |