mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-24 09:58:51 +00:00
Auto-close conversation chat on user removal
This commit is contained in:
parent
ce0397d5be
commit
2e1dc48671
@ -1485,4 +1485,18 @@ document.addEventListener("deletedConvMessage", (e) => {
|
||||
return;
|
||||
|
||||
target.style.display = "none";
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// Register to conversation removal
|
||||
document.addEventListener("removedUserFromConv", e => {
|
||||
const msg = e.detail;
|
||||
|
||||
if (msg.user_id != userID())
|
||||
return;
|
||||
|
||||
if(!ConvService.__serviceCache.hasOwnProperty("conversation-" + msg.conv_id))
|
||||
return;
|
||||
|
||||
ConvChatWindow.__conversationsCache["conversation-"+msg.conv_id].box.closeFunction();
|
||||
});
|
Loading…
Reference in New Issue
Block a user