mirror of
https://github.com/jech/galene.git
synced 2024-12-25 08:45:48 +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;
|
||||
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;
|
||||
let div = row.firstChild;
|
||||
console.log(div);
|
||||
if(!(div instanceof HTMLDivElement))
|
||||
continue;
|
||||
if((!id || div.dataset.id === id) && div.dataset.peerId === userId)
|
||||
box.removeChild(row);
|
||||
if(row instanceof HTMLDivElement) {
|
||||
let div = row.firstChild;
|
||||
if(div instanceof HTMLDivElement)
|
||||
if((!id || div.dataset.id === id) &&
|
||||
div.dataset.peerId === userId) {
|
||||
box.removeChild(row);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue