From c227b113f6b2dbc51879b6c7d1877f70c2a301d5 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sat, 31 Jul 2021 16:25:03 +0200 Subject: [PATCH] Use id for determining source of chat message. We used to check the nick, which is not necessarily unique. --- static/galene.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/static/galene.js b/static/galene.js index d2bc9a7..5983751 100644 --- a/static/galene.js +++ b/static/galene.js @@ -2310,7 +2310,6 @@ let lastMessage = {}; * @param {unknown} message */ function addToChatbox(peerId, dest, nick, time, privileged, history, kind, message) { - let userpass = getUserPass(); let row = document.createElement('div'); row.classList.add('message-row'); let container = document.createElement('div'); @@ -2320,7 +2319,7 @@ function addToChatbox(peerId, dest, nick, time, privileged, history, kind, messa footer.classList.add('message-footer'); if(!peerId) container.classList.add('message-system'); - if(userpass.username === nick) + if(peerId === serverConnection.id) container.classList.add('message-sender'); if(dest) container.classList.add('message-private');