show profile pictures in chat online list

pull/102/head
Aevann 2023-01-27 19:52:47 +02:00
parent 3c61799977
commit 4a795d924f
2 changed files with 5 additions and 5 deletions

View File

@ -202,10 +202,10 @@ socket.on('online', function(data){
for (const u of data[0])
{
online += `<li>`
if (admin_level && Object.keys(data[1]).includes(u.toLowerCase()))
if (admin_level && Object.keys(data[1]).includes(u[0].toLowerCase()))
online += '<b class="text-danger muted" data-bs-toggle="tooltip" title="Muted">X</b> '
online += `<a href="/@${u}">@${u}</a></li>`
online2 += `<br>@${u}`
online += `<a href="/@${u[0]}"><img loading="lazy" class="avatar-pic pp20 mr-1" src="/pp/${u[1]}">${u[0]}</a></li>`
online2 += `<br>@${u[0]}`
}
document.getElementById('online').innerHTML = online
bs_trigger(document.getElementById('online'))

View File

@ -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)