mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-25 09:54:34 +00:00
✨ add user_id field to Member
This commit is contained in:
@@ -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"] });
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user