🐛 fix relationship

This commit is contained in:
Flam3rboy
2021-09-13 12:22:41 +02:00
parent 07ba78d391
commit dbbed7cbba
4 changed files with 94 additions and 65 deletions
+5 -2
View File
@@ -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: [],