From dbbed7cbba8d5967d5b2bdc8a666fce22ac0e22c Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Mon, 13 Sep 2021 12:22:41 +0200 Subject: :bug: fix relationship --- gateway/src/opcodes/Identify.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gateway') diff --git a/gateway/src/opcodes/Identify.ts b/gateway/src/opcodes/Identify.ts index 88c9b942..9eb4cd32 100644 --- a/gateway/src/opcodes/Identify.ts +++ b/gateway/src/opcodes/Identify.ts @@ -104,7 +104,10 @@ export async function onIdentify(this: WebSocket, data: Payload) { } return x.channel; }); - const user = await User.findOneOrFail({ id: this.user_id }); + const user = await User.findOneOrFail({ + where: { id: this.user_id }, + relations: ["relationships", "relationships.to"], + }); if (!user) return this.close(CLOSECODES.Authentication_failed); const public_user = { @@ -171,7 +174,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { }), guild_experiments: [], // TODO geo_ordered_rtc_regions: [], // TODO - relationships: user.relationships, + relationships: user.relationships.map((x) => x.toPublicRelationship()), read_state: { // TODO entries: [], -- cgit 1.4.1