Gateway: get around some typeorm weirdness

This commit is contained in:
Rory& committed 2026-04-18 18:26:34 +02:00
1 parent 7dcccdcd6c
commit 3687202788
1 file changed
+4
+4
View File
@@ -167,6 +167,10 @@ export async function onIdentify(this: WebSocket, data: Payload) {
// this.session.status = identify.presence?.status || "online";
this.session.last_seen = new Date();
this.session.client_info ??= {};
// noinspection SuspiciousTypeOfGuard - typeorm being weird
if (typeof this.session.client_info === "string") this.session.client_info = JSON.parse(this.session.client_info);
// noinspection SuspiciousTypeOfGuard - typeorm being weird
if (typeof this.session.last_seen_location_info === "string") this.session.last_seen_location_info = JSON.parse(this.session.last_seen_location_info);
this.session.client_info.platform = identify.properties?.$device ?? identify.properties?.$device;
this.session.client_info.os = identify.properties?.os || identify.properties?.$os;
this.session.client_status = {};