summary refs log tree commit diff
path: root/gateway
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-13 12:22:41 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-13 12:22:41 +0200
commitdbbed7cbba8d5967d5b2bdc8a666fce22ac0e22c (patch)
treebcd33ccb16c3e1dbebc38544f0b4971a3b98cf2d /gateway
parent:bug: fix dm #321 (diff)
downloadserver-dbbed7cbba8d5967d5b2bdc8a666fce22ac0e22c.tar.xz
:bug: fix relationship
Diffstat (limited to 'gateway')
-rw-r--r--gateway/src/opcodes/Identify.ts7
1 files changed, 5 insertions, 2 deletions
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: [],