aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sockets.js6
-rw-r--r--lib/utils.js1
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/sockets.js b/lib/sockets.js
index 8a5ef958..366820e0 100644
--- a/lib/sockets.js
+++ b/lib/sockets.js
@@ -1,4 +1,5 @@
import store from "./store";
+import config from "$config";
import app from "$app";
import jwt from "jsonwebtoken";
import { v4 } from "uuid";
@@ -6,6 +7,9 @@ import WebSocket from "ws";
import { differenceInSeconds, subSeconds } from "date-fns";
import fastifyWs from "@fastify/websocket";
import whitelist from "./whitelist";
+import { l, err, warn } from "$lib/logging";
+import { getUser } from "$lib/utils";
+import db from "$db";
const code = 1000;
@@ -36,7 +40,7 @@ export const emit = (username, type, data) => {
}
if (!store.sockets[username]) return;
- for (id in store.sockets[username]) {
+ for (let id in store.sockets[username]) {
const ws = store.sockets[username][id];
ws.send(JSON.stringify({ type, data }));
}
diff --git a/lib/utils.js b/lib/utils.js
index af50d7ec..a7db0ea3 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -1,3 +1,4 @@
+import db from "$db";
import sequelize from '@sequelize/core';
const { Op } = sequelize;