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:
parent
2c56143ba0
commit
e8b12d3729
1 changed files with 12 additions and 9 deletions
|
@ -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;
|
||||||
console.log(div);
|
if(div instanceof HTMLDivElement)
|
||||||
if(!(div instanceof HTMLDivElement))
|
if((!id || div.dataset.id === id) &&
|
||||||
continue;
|
div.dataset.peerId === userId) {
|
||||||
if((!id || div.dataset.id === id) && div.dataset.peerId === userId)
|
|
||||||
box.removeChild(row);
|
box.removeChild(row);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue