forked from rDrama/rDrama
switch around the id and username in chat online list
parent
eed9d490c1
commit
4d2b7be757
|
@ -198,10 +198,10 @@ socket.on('online', function(data){
|
||||||
patron = ` class="patron" style="background-color:#${u[2]}"`
|
patron = ` class="patron" style="background-color:#${u[2]}"`
|
||||||
|
|
||||||
online += `<li>`
|
online += `<li>`
|
||||||
if (admin_level && Object.keys(data[1]).includes(u[0].toLowerCase()))
|
if (admin_level && Object.keys(data[1]).includes(u[1].toLowerCase()))
|
||||||
online += '<b class="text-danger muted" data-bs-toggle="tooltip" title="Muted">X</b> '
|
online += '<b class="text-danger muted" data-bs-toggle="tooltip" title="Muted">X</b> '
|
||||||
online += `<a class="font-weight-bold" target="_blank" href="/@${u[0]}" style="color:#${u[2]}"><img loading="lazy" class="mr-1" src="/pp/${u[1]}"><span${patron}>${u[0]}</span></a></li>`
|
online += `<a class="font-weight-bold" target="_blank" href="/@${u[1]}" style="color:#${u[2]}"><img loading="lazy" class="mr-1" src="/pp/${u[0]}"><span${patron}>${u[1]}</span></a></li>`
|
||||||
online2 += `<br>@${u[0]}`
|
online2 += `<br>@${u[1]}`
|
||||||
}
|
}
|
||||||
|
|
||||||
const online_el = document.getElementById('online')
|
const online_el = document.getElementById('online')
|
||||||
|
|
|
@ -200,7 +200,7 @@ def refresh_online():
|
||||||
def remove_from_online(v):
|
def remove_from_online(v):
|
||||||
for li in online.values():
|
for li in online.values():
|
||||||
for entry in li:
|
for entry in li:
|
||||||
if entry[1] == v.id:
|
if entry[0] == v.id:
|
||||||
li.remove(entry)
|
li.remove(entry)
|
||||||
|
|
||||||
@socketio.on('connect')
|
@socketio.on('connect')
|
||||||
|
@ -217,7 +217,7 @@ def connect(v):
|
||||||
|
|
||||||
remove_from_online(v)
|
remove_from_online(v)
|
||||||
|
|
||||||
online[g.referrer].append([v.username, v.id, v.name_color, v.patron])
|
online[g.referrer].append([v.id, v.username, v.name_color, v.patron])
|
||||||
|
|
||||||
refresh_online()
|
refresh_online()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue