From ce182275027c3202a1fa4dcf6b0ed87ede79da37 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 16 Jun 2023 12:54:10 +0200 Subject: Update user last seen when connecting to websocket. --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server.js') diff --git a/server.js b/server.js index 07a6a9b..89b92d6 100644 --- a/server.js +++ b/server.js @@ -2267,8 +2267,10 @@ wss.on('connection', (socket, req) => { let sid = login_cookie(req) if (sid) user_id = login_sql_select.get(sid) - if (user_id) + if (user_id) { socket.user = SQL_SELECT_USER_VIEW.get(user_id) + SQL_UPDATE_USER_LAST_SEEN.run(user_id) + } socket.ip = req.headers["x-real-ip"] || req.ip || req.connection.remoteAddress || "0.0.0.0" socket.title_id = req.query.title || "unknown" -- cgit v1.2.3