add user_id field to Member

This commit is contained in:
Flam3rboy
2021-09-02 19:50:05 +02:00
parent c410fbcc0d
commit 562a53d6bb
17 changed files with 68 additions and 80 deletions
+1 -1
View File
@@ -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"] });
+1 -1
View File
@@ -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) => {
+1
View File
@@ -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