From cd9e84a337c72709b82bb4eca794ec7474a0ee7e Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 27 Jul 2024 15:18:07 +0200 Subject: [PATCH] refactor: clean up relationship fix --- src/websocket/client.ts | 6 +----- src/websocket/notifications.ts | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/websocket/client.ts b/src/websocket/client.ts index 84f130b5..e9321c94 100644 --- a/src/websocket/client.ts +++ b/src/websocket/client.ts @@ -671,13 +671,9 @@ export class WebSocketClient { } case "UserRelationship": { - packet.status = packet.user.relationship!; const user = this.client.users.get(packet.user._id); if (user) { - user.update({ - ...packet.user, - relationship: packet.status, - }); + user.update(packet.user); } else { this.client.users.createObj(packet.user); } diff --git a/src/websocket/notifications.ts b/src/websocket/notifications.ts index 6e1d2e88..66ca7b48 100644 --- a/src/websocket/notifications.ts +++ b/src/websocket/notifications.ts @@ -127,7 +127,7 @@ export type ClientboundNotification = data: Partial; clear?: FieldsUser[]; } - | { type: "UserRelationship"; user: User; status: RelationshipStatus } + | { type: "UserRelationship"; user: User } | { type: "UserPresence"; id: string; online: boolean } | { type: "UserSettingsUpdate";