1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-12-26 09:15:46 +01:00

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.
This commit is contained in:
Juliusz Chroboczek 2024-12-24 01:06:10 +01:00
parent 2c56143ba0
commit e8b12d3729

View file

@ -3319,16 +3319,19 @@ function clearChat(id, userId) {
} }
let elts = box.children; let elts = box.children;
for(let i = 0; i < elts.length; i++) { let i = 0;
while(i < elts.length) {
let row = elts.item(i); let row = elts.item(i);
if(!(row instanceof HTMLDivElement)) if(row instanceof HTMLDivElement) {
continue; let div = row.firstChild;
let div = row.firstChild; if(div instanceof HTMLDivElement)
console.log(div); if((!id || div.dataset.id === id) &&
if(!(div instanceof HTMLDivElement)) div.dataset.peerId === userId) {
continue; box.removeChild(row);
if((!id || div.dataset.id === id) && div.dataset.peerId === userId) continue;
box.removeChild(row); }
}
i++;
} }
} }