Commit c227b113 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use id for determining source of chat message.

We used to check the nick, which is not necessarily unique.
parent b527c875
...@@ -2310,7 +2310,6 @@ let lastMessage = {}; ...@@ -2310,7 +2310,6 @@ let lastMessage = {};
* @param {unknown} message * @param {unknown} message
*/ */
function addToChatbox(peerId, dest, nick, time, privileged, history, kind, message) { function addToChatbox(peerId, dest, nick, time, privileged, history, kind, message) {
let userpass = getUserPass();
let row = document.createElement('div'); let row = document.createElement('div');
row.classList.add('message-row'); row.classList.add('message-row');
let container = document.createElement('div'); let container = document.createElement('div');
...@@ -2320,7 +2319,7 @@ function addToChatbox(peerId, dest, nick, time, privileged, history, kind, messa ...@@ -2320,7 +2319,7 @@ function addToChatbox(peerId, dest, nick, time, privileged, history, kind, messa
footer.classList.add('message-footer'); footer.classList.add('message-footer');
if(!peerId) if(!peerId)
container.classList.add('message-system'); container.classList.add('message-system');
if(userpass.username === nick) if(peerId === serverConnection.id)
container.classList.add('message-sender'); container.classList.add('message-sender');
if(dest) if(dest)
container.classList.add('message-private'); container.classList.add('message-private');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment