Commit e8b12d37 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Fix client-side selective clearChat.

We were correctly clearing the chat on the server side, but
we were leaving stray entries in the client.

Thanks to J.-J. Sarton.
parent 2c56143b
......@@ -3319,16 +3319,19 @@ function clearChat(id, userId) {
}
let elts = box.children;
for(let i = 0; i < elts.length; i++) {
let i = 0;
while(i < elts.length) {
let row = elts.item(i);
if(!(row instanceof HTMLDivElement))
continue;
if(row instanceof HTMLDivElement) {
let div = row.firstChild;
console.log(div);
if(!(div instanceof HTMLDivElement))
continue;
if((!id || div.dataset.id === id) && div.dataset.peerId === userId)
if(div instanceof HTMLDivElement)
if((!id || div.dataset.id === id) &&
div.dataset.peerId === userId) {
box.removeChild(row);
continue;
}
}
i++;
}
}
......
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