mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-22 19:43:16 +00:00
Gateway: get around some typeorm weirdness
This commit is contained in:
1 parent
7dcccdcd6c
commit
3687202788
1 file changed
+4
@@ -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 = {};
|
||||
|
||||
Reference in new issue
Block a user