From 4a795d924f663f2454e6f4b0c5a590c6f0f4f44b Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 27 Jan 2023 19:52:47 +0200 Subject: [PATCH] show profile pictures in chat online list --- files/assets/js/chat.js | 6 +++--- files/routes/chat.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/files/assets/js/chat.js b/files/assets/js/chat.js index ef16142ac..b1f8088ce 100644 --- a/files/assets/js/chat.js +++ b/files/assets/js/chat.js @@ -202,10 +202,10 @@ socket.on('online', function(data){ for (const u of data[0]) { online += `
  • ` - if (admin_level && Object.keys(data[1]).includes(u.toLowerCase())) + if (admin_level && Object.keys(data[1]).includes(u[0].toLowerCase())) online += 'X ' - online += `@${u}
  • ` - online2 += `
    @${u}` + online += `${u[0]}` + online2 += `
    @${u[0]}` } document.getElementById('online').innerHTML = online bs_trigger(document.getElementById('online')) diff --git a/files/routes/chat.py b/files/routes/chat.py index 178557275..e69d42bd9 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -163,8 +163,8 @@ def connect(v): join_room(request.referrer) - if v.username not in online: - online.append(v.username) + if [v.username, v.id] not in online: + online.append([v.username, v.id]) refresh_online() emit('typing', typing[request.referrer], room=request.referrer)